Location: Cologne, Germany
Occupation: Second Vice President of Distributed Junk and Trash Development
For me, "ListData" return the same error than ItemData.
please try this snippet:
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Public Sub List1_Click() MsgBox List1.ListData(List1.ListIndex) End Sub Public Sub Form_Load() Dim Counter As Integer For Counter = 0 To 100 List1.AddItem "Item" + Cstr(Counter) List1.ListData(List1.ListCount-1) = "ItemData" + Cstr(Counter) Next End Sub |
Greetings ... Peter
Location: Cologne, Germany
Occupation: Second Vice President of Distributed Junk and Trash Development
ListData works with a ListBox, but don't work with ComboBox...
sorry, i didn't read your first posting correctly.how about this solution?
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
Type tComboboxItems Item As String Data As String End Type Dim ComboboxItems() As tComboboxItems Public Sub Form_Load() Dim Counter As Integer ReDim ComboboxItems(100) For Counter = 0 To 100 ComboboxItems(Counter).Item = "Item" + Cstr(Counter) ComboboxItems(Counter).Data = "Data" + Cstr(Counter) ComboBox1.AddItem ComboboxItems(Counter).Item Next End Sub Public Sub ComboBox1_Change() MsgBox(ComboboxItems(ComboBox1.ListIndex).Data) End Sub |
Greetings ... Peter
