Click to See Complete Forum and Search --> : Combo Box


chewlim
September 13th, 1999, 09:08 PM
I had created a ComboBox using :-


handle = CreateWindowEx(...,"COMBOBOX",CBS_DROPDOWNLIST | WS_CHILD,...);
SendMessage(handle,CB_ADDSTRING,0,(LPARAM)(LPSTR)myText);





It created the ComboBox, and it looks fine. BUT when i clicked the ComboBox, the drop down list appears to be one thin line.
I had tried :-


SendMessage(handle,CB_SETITEMHEIGHT,...,...);




and had used several setting but it still appear as a thin line.

Please advice,
Thanks.

chewlim

Thomas Ascher
September 14th, 1999, 01:45 AM
To set the height of the dropdown listbox you must use the height of the combobox rectangle.

CreateWindowEx(0, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD,
0, 0, 50, 100 /*=height including dropdown listbox*/, ...);

chewlim
September 14th, 1999, 03:35 AM
Thanks, it works.

But I another problem, the drop down list doesnt have a scroll bar.
When my items get larger, the drop down list only display partial list.

Please advice,
Thanks.

chewlim

kishk91
September 14th, 1999, 03:43 AM
add this WS_VSCROLL o the window style

handle = CreateWindowEx(...,"COMBOBOX",CBS_DROPDOWNLIST | WS_CHILD |WS_VSCROLL ,...);




HTH
kishk91


kishk91@hotmail.com
http://www.path.co.il

Thomas Ascher
September 14th, 1999, 03:45 AM
You must create the combobox with the WS_VSCROLL window-style to get a scrollbar.

Oleg Lobach
September 14th, 1999, 03:47 AM
Hi, try this:

CreateWindowEx(WS_EX_RIGHTSCROLLBAR, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD,0, 0, 50, 100 );



Good luck,
Oleg.

chewlim
September 14th, 1999, 04:28 AM
Thank you for your help...