-
Combo text update
OS Win98
Compiler: VC6++
Subject: Combo boxes
Trying to insert/add a string a combo box, but failing. I don't get an error but the string isn't added. Pointers?
Code:
case WM_COMMAND:
switch(wParam){
case BS_PUSHBUTTON:
if (SendMessage(hCombo,CB_ADDSTRING ,0,(LPARAM)"ABCDEF")!=CB_ERR)
UpdateWindow(hCombo);
MessageBox(hwnd,"Combo updated","",MB_OK);
break;
Thanks
hmm
-
hmm.. did you draw the ComboBox in a dialog?? than you should drag the box to fit at least one item... for more info look at: http://winprog.org/tutorial/dlgfaq.html
-
Thanks Jop,
No, I used the CreateWindowEx function to create it.
Code:
hCombo = CreateWindowEx(
NULL,"COMBOBOX","Copy Disk:",
WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST|CBS_AUTOHSCROLL,
25, 20, 150, 5,hwnd, NULL, hInstance, NULL);
I'm sure its something simple I'm missing :confused:
:)
hmm
-
case BS_PUSHBUTTON:
is the id of your button really BS_PUSHBUTTON? Is the code actually called (does the message box show up)?
Anyway, you have to set a far larger height value in your CreateWindowEx call. The height you specify there is for the extended list too.
-
Thank you CornedBee!
It was the height property that was causing the problem! Should have seen that one :eek:
Thanks CornedBee !
:)
hmm