Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo list

Status
Not open for further replies.

jayjay60

Programmer
Jun 19, 2001
97
FR
I would like to know how use the instructions switch, case... with a combo list.
I explain it: If i have names in the combo list, and for each name i want to do different actions, for example just create specific afxmessagebox for each name. I know that the better way to do that is to use the switch command, but as it take only numeric expression how could i solve it?

thanks in advance

gerald
 
Each string in Combo has an index what is its ID. See the notification messages must have them. John Fill
1c.bmp


ivfmd@mail.md
 
what do you mean by "see the notification messages must have them"
 
See how are you handle notification messages from your COMBO. In them is contained the index of the string. John Fill
1c.bmp


ivfmd@mail.md
 
See for example
SendMessage( hWndCombo, CB_GETITEMDATA,itemIDX,0); gets the data of item with index CB_GETITEMDATA John Fill
1c.bmp


ivfmd@mail.md
 
I believe that understand what you mean but how could i do the link with the switch method, i need of numeric value?
 
When you handle WM_COMMAND from your COMBO in wParam or in lParam is containing the handle to combo item. Just use this handle to get the numeric index. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top