|
-
May 19th, 2010, 06:28 PM
#1
Thread Starter
Member
[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
-
May 19th, 2010, 06:36 PM
#2
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).
-
May 19th, 2010, 06:49 PM
#3
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.
-
May 19th, 2010, 07:02 PM
#4
Thread Starter
Member
Re: Setting listindex for a listbox that has index
 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. 
It hit me finally, that I wasn't adding the values to the list for each list on load up.
-
May 23rd, 2010, 07:08 PM
#5
Re: Setting listindex for a listbox that has index
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|