[RESOLVED] Setting listindex for a listbox that has index
i have a program that has 25 listboxs indexed, 1 thru 25. However I can't seem to change the list index for each listbox while loading settings.
Example
Code:
lstTask(bla).ListIndex = sGetINI(App.Path & "\MYAPP.INI", txtEmail, "LstTask", "0")
What am I doing wrong, when code is ran, the lsttask.list is cleared
Re: Setting listindex for a listbox that has index
Did you try stepping though code to see what value the sGetINI returns?
Also, what does the application do? Just curious as 25 listboxes sounds a bit much (unless you use them in the background for whatever reason and are not visible to the user).
Re: Setting listindex for a listbox that has index
Usually when you set a list index to any empty list or set it to a value that equals or exceeds the list count, you will receive an immediate error message.
I have never heard of a situation where setting a list index to any value ever clears the elements within a list. :confused:
Re: Setting listindex for a listbox that has index
Quote:
Originally Posted by
Code Doc
Usually when you set a list index to any empty list or set it to a value that equals or exceeds the list count, you will receive an immediate error message.
I have never heard of a situation where setting a list index to any value ever clears the elements within a list. :confused:
It hit me finally, that I wasn't adding the values to the list for each list on load up.
Re: Setting listindex for a listbox that has index
Quote:
Originally Posted by
VbCoder2008
It hit me finally, that I wasn't adding the values to the list for each list on load up.
That would do it. Glad we could help you. :)