Results 1 to 8 of 8

Thread: How can I make a listbox - style=Checkbox to start its index with one instead of zero

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Florida, USA
    Posts
    93

    Question How can I make a listbox - style=Checkbox to start its index with one instead of zero

    I have a listbox, style = checkbox, and I want its index to start with one instead of zero, is that possible????

  2. #2
    Hyperactive Member Knowledge_is_Et's Avatar
    Join Date
    Dec 2001
    Location
    An Oak.
    Posts
    305
    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...
    Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.

  3. #3
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    How you came up with this?
    Why would you need it?

  4. #4
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    ya...... juse use '0' as the index..... why do you need '1' ?

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    If it is for a loop you want this try making the listindex you have listindex+1 in the loop process.


    Has someone helped you? Then you can Rate their helpful post.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Florida, USA
    Posts
    93
    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.

  7. #7
    Hyperactive Member Knowledge_is_Et's Avatar
    Join Date
    Dec 2001
    Location
    An Oak.
    Posts
    305
    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
    Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.

  8. #8
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Then the listindex you want in the combo box will be the listindex of the listbox+1 right?

    VB Code:
    1. Combo1.ListIndex = List1.ListIndex + 1

    Something like this?


    Has someone helped you? Then you can Rate their helpful post.

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