I have a listbox, style = checkbox, and I want its index to start with one instead of zero, is that possible????:confused:
Printable View
I have a listbox, style = checkbox, and I want its index to start with one instead of zero, is that possible????:confused:
No, you cannot. If you remove the first item, it will simply shift the indexes of the other items so that the first one is always 0.
of course, that would be fun to add to my listbox...
How you came up with this?:confused:
Why would you need it?
ya...... juse use '0' as the index..... why do you need '1' ?
If it is for a loop you want this try making the listindex you have listindex+1 in the loop process.
Quote:
Originally posted by manavo11
If it is for a loop you want this try making the listindex you have listindex+1 in the loop process.
The reason is that I have another combo box with the same list as the listbox exept the first item on the combobox is not in the listbox, so I need to sync those two controls, and I use the index to store and retreive some items to a collection.
So I have per say two items in the listbox but in the combobox I have three, so the index in the combobox will be 0,1,2 and in the listbox 0,1
and the item No1 in the combobox is not in the listbox, so I need the lisbox index's to be 1,2
to sync with the combobox.
just use the index of the item in the combo box + 1
combo = 0,1,2,3,4
list = 0,1,2,3
list + 1 = 1,2,3,4
Then the listindex you want in the combo box will be the listindex of the listbox+1 right?
VB Code:
Combo1.ListIndex = List1.ListIndex + 1
Something like this?