i try to add a string to a combobox that i have in my dialog. the string just doesn't appear. when i click this little error, the lower border of it is a bit thicker, like if the string is behind the combo box? here is the resource part, and after that follows the code part:

COMBOBOX 3500,146,51,101,12,CBS_DROPDOWN | WS_VSCROLL |
WS_TABSTOP

invoke SendDlgItemMessage,hWnd,3500,CB_INSERTSTRING,-1,addr patchstr

why doesn't that work? i'm sure that the handles are ok!

thanks,
NOP-erator
Posted on 2001-09-18 14:45:00 by NOP-erator
The height of the combobox must also include the space that the menuitems are occupying.


/Delight
Posted on 2001-09-18 15:28:58 by Delight
sorry, i dont understand that. could you please explain better and how to solve the problem?

NOP-erator
Posted on 2001-09-19 03:37:17 by NOP-erator
Wenn du in einer Combobox 5 Eintr?ge hast, muss die H?he der Combobox nicht 12 pixel (?) wie in deinem Beispiel sondern 80 oder so sein. Mit "H?he" ist bei einer Combobox also die "ausgeklappte" H?he gemeint.

Kapiert? :)
Posted on 2001-09-19 04:39:23 by bazik
I'm not sure that it's going to solve it, but I had some problems with a combobox some time ago and after an hour of debuging I realized that it wasn't my code that was wrong. The problem was that the specified height of the CB must include the height of the menu that pops up when clicking on the small arrow.

Conclution: Iincrease the height of your CB so that the menuitems can fit inside it

/Delight
Posted on 2001-09-19 04:46:45 by Delight
hi,
thanks, it worked, i just made the box bigger. but i've still one question: how to prevent that the user can change the text in the combo box?

thanks in advance.

NOP-erator
Posted on 2001-09-19 11:23:12 by NOP-erator
You have to use the CBS_DROPDOWNLIST style instead of CBS_DROPDOWN. With this style user can't edit text, but only choose from the list.
Posted on 2001-09-19 12:55:21 by LuHa
hi,
thank you very much for your answers! i'm programming in assembler a long time, now, some of you know that i'm not a newbie anymore, but i never did anything with combo boxes, so i really appreceate that message board. it's great! (although i'm registered for about 2 years now :alright: )

bye

NOP-erator
Posted on 2001-09-19 14:31:43 by NOP-erator