Автор | Delphi нужна помощь |
Помогите пожалуйста вспомнить как работать с listBox.
Совершенно вылетело из головы как сделать чтобы когда кликаеш по некой строчке в нем - то делаеться одно, кликаеш по другой другое. Или хотя бы проверку на то, что сейчас в нем выбрано.
Обещаю награду |
В процедуре onclick смотришь какой индекс строки или че там написано. |
В том то и дело, забыл как смотреть индекс... |
property ItemIndex: Integer;
Description
Use ItemIndex to select an item at runtime. Set the value of ItemIndex to the index of the item to be selected. The ItemIndex of the first item in the list box is 0. If no item is selected, the value is -1, which is the default value unless MultiSelect is True.
If the value of the MultiSelect property is True the user can select more than one item in the list box. In this case, the ItemIndex value is the index of the selected item that has focus. If MultiSelect is True, ItemIndex defaults to 0. |
Попробую покликать на листбокс или в панели справа. |
Я всегда сталвю на тестовю форму компонент и потом по хелпу шаманю. |
для Crag_Hack:
Точно, listbox1.itemindex=0;
премного благодарен |
тема закрыта by KopcapC8 (2010-01-26 12:34:31) |
---|