gingerellies![]() Member Posts: 50 From: Orlando, FL Registered: 05-28-2002 |
Can anyone help me, I need to make a comboboz for a tool I am making. It will be similar to a tile editor, but more specific to our needs. Anyway, I have been all over MSDN and I can't seem to get the info I need. I really just want a dropdown box with some choices in it, I don't need the user to be able to add items to the list, but I guess it would be ok if I have to have that option. I am using C++ to program a WIN32 App. I am using Visual C++ 6.0. I hope that's all the info you need, if it wasn't clear just let me know and I will clearify. Thanks! ![]() ------------------ |
||
rowanseymour![]() Member Posts: 284 From: Belfast, Northern Ireland Registered: 02-10-2001 |
Is this for dialog box or toolbar ? Are you using MFC or straight Win32 controls ? 1. Use the resource editor to create the dialog box If using MFC you will access the combo box with something like:
(where IDC_MYCOMBOBOX is the control name you gave it and pDlg is a pointer to your MFC dialog box) If using the Win32 API you will access the combo box with something like:
(where IDC_MYCOMBOBOX is the control name you gave it and hWnd is the handle to your dialog box) Hope this helps ! ------------------ |
||
gingerellies![]() Member Posts: 50 From: Orlando, FL Registered: 05-28-2002 |
It is for dialog box with straight win32. Yes, that was very helpful! Do I make a call like that for every item in the list, and how do I control what happens when the click on one, or how do I know they even clicked on one? ------------------ |
||
rowanseymour![]() Member Posts: 284 From: Belfast, Northern Ireland Registered: 02-10-2001 |
From memory i think you'll want something like this in your dialog procedure...
Check out the MSDN stuff on combo boxes, you'll find a list their of all the notification messages sent by combo box controls and how to handle them. Good luck ! ------------------ |
||
gingerellies![]() Member Posts: 50 From: Orlando, FL Registered: 05-28-2002 |
ok, I think I've got it working, except, when I push the dropdown button thingy (technical term ![]() ![]() ------------------ |
||
rowanseymour![]() Member Posts: 284 From: Belfast, Northern Ireland Registered: 02-10-2001 |
You need to increase the height of the combobox on the dialog. I recall there is some problem with resource editor not letting you increase it more than than one text line high, but you can edit it in the RC file Find the following line in your .RC file where IDC_MYCOMBOBOX is the name of your combobox. The 4th number is the height - make sure this is set to at least 60 or 70.
------------------ |
||
gingerellies![]() Member Posts: 50 From: Orlando, FL Registered: 05-28-2002 |
THANK YOU, THANK YOU, THANK YOU!!! That was extremely helpful! That was the problem! You are a gem! ![]() ------------------ |