Results 1 to 6 of 6

Thread: Combo Box help

  1. #1
    ChimpFace9000
    Guest

    Post

    Im gonna add about 1000 items to a combo box. And then when someone clicks a button, i need to get the corresponding number to each string. My quesiton is do i have to compare whatever string they pick to 1000 others using case statements, or can i give data to each string that i give the combo box, and then just get the data with the string.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    How about an array using the index of the combo box:
    Code:
    int pArray[1000] = { ... };
    Although if there's 1000 items it would be a much better idea to load them dynamically from a data file.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    ChimpFace9000
    Guest
    I thought about that, but i want the combo box to be sorted, so all the items would be out of wack.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    An array of UDTs? Try using the STL map class?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    ChimpFace9000
    Guest
    Class? Are you talking MFC? Cuz im not using MFC.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Nope. I'm talking the C++ Standard Library, of which the STL (Standard Template Library) is a part.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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