如何知道Listbox中所选项.
我在一个Listbox中有十多条记录,现在我要知道:当我用光标点击其中任意一项时,如何将所选中的该项保存在字符串变量itemname中?在线等各位高手指教!!! 问题点数:20、回复次数:7Top
1 楼jetwang(jetwang)回复于 2002-05-09 18:00:08 得分 5
itemname := listbox.Items.Strings[listbox.ItemIndex]Top
2 楼colacoca(我是一瓶倒过来的可口可乐)回复于 2002-05-09 18:00:49 得分 4
str: string;
str:=ListBox1.Items[ListBox1.ItemIndex];Top
3 楼loveandhate(西门吹雪)回复于 2002-05-09 18:03:12 得分 4
var itemname :tstrings;
itemname := listbox1.Items.Strings[listbox1.ItemIndex]
Top
4 楼tuboo(阿文)回复于 2002-05-09 18:04:07 得分 2
前面两位老兄的方法实际是一样的 说得没错!Top
5 楼inbud(清风侠)回复于 2002-05-09 18:04:58 得分 5
if Listbox.ItemIndex>-1 then
itemname:=Listbox.Items[Listbox.ItemIndex];Top
6 楼colacoca(我是一瓶倒过来的可口可乐)回复于 2002-05-09 18:06:33 得分 0
两种皆可Top
7 楼colacoca(我是一瓶倒过来的可口可乐)回复于 2002-05-09 18:08:56 得分 0
回复人: jetwang(jetwang) ( ) 信誉:100 2002-05-09 18:00:00 得分:0
回复人: colacoca(我是一瓶倒过来的可口可乐) ( ) 信誉:100 2002-05-09 18:00:00
吐血,发表的时间一样啊,为什么他的排在我前面!!!老天没眼啊!!!
Top




