Results 1 to 5 of 5

Thread: [RESOLVED] Setting listindex for a listbox that has index

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2008
    Posts
    39

    Resolved [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

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    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).

  3. #3
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    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.
    Doctor Ed

  4. #4

    Thread Starter
    Member
    Join Date
    Mar 2008
    Posts
    39

    Re: Setting listindex for a listbox that has index

    Quote Originally Posted by Code Doc View Post
    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.

  5. #5
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: Setting listindex for a listbox that has index

    Quote Originally Posted by VbCoder2008 View Post
    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.
    Doctor Ed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width