|
-
May 18th, 2002, 11:18 AM
#1
Thread Starter
Member
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
-
May 18th, 2002, 12:24 PM
#2
Frenzied Member
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
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
May 19th, 2002, 03:17 AM
#3
Thread Starter
Member
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
hmm
-
May 24th, 2002, 09:12 AM
#4
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 25th, 2002, 03:04 AM
#5
Thread Starter
Member
Thank you CornedBee!
It was the height property that was causing the problem! Should have seen that one
Thanks CornedBee !
hmm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|