[help] combo box > mssql data

Joined
Sep 22, 2005
Messages
215
Reaction score
11
I am making my first APP and I decided to make a GM Tool "Character Editor".
So far everything is going well, except for the combo box I'm using for Character Authority.

The combo box does work and you can change the authority but it just shows up the same way it does in the DB which is just a number.

0 = GM
1 = Normal Player
2 = Muted Player
3 = Banned Player

The combo box shows up 0-3 and is changeable although I want it to show the name but still keep the data in the DB the way already is 0-3.

Ive tried using the IF function for the combo box itself but it just returns errors. I'm really new at this and don't have a clue about what I'm doing really.

Example of current combo box set up

BOX1 you select the character
BOX2 shows players authority 0-3 "When clicked you can select players authority 0-3"

Example of what I want to do

BOX1 select character
BOX2 shows players authority "GM, NORMAL, MUTED, BANNED"


I have searched the web trying to find something similar, but I haven't been able to find anything.
Any help would be much appreciated.

Thanks
 
CBN_SELCHANGE
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775821(v=vs.85).aspx

WM_COMMAND
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647591(v=vs.85).aspx

CB_GETCURSEL
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775845(v=vs.85).aspx

CB_GETLBTEXT
http://msdn.microsoft.com/en-us/library/windows/desktop/bb775862(v=vs.85).aspx


n steps to glory (common cycle):
1. User makes selection, CB sends notification "CBN_SELCHANGE" to the parent window
2. Retrieve handle from lParam field of the notification (via WM_COMMAND)
3. Send CB_GETCURSEL msg to the combo box to retrieve the selected item index
4. Send CB_GETLBTEXT msg (don't forget to display it)
 
Back