C language > Windows questions
WIN32 ComboBox control
John Z:
Does anyone know of a way to control the height of the edit box section in the ComboBox list control? The control 'height' setting is for the entire drop down list. The height of the top edit box portion seems to be solely set by the font size being used, however I would like to control it independently from the font.
Of course I can simulate a ComboBox with an edit box and a list box and overcome the ComboBox limitation but just checking to see if I've overlooked something.
Thanks,
John Z
TimoVJL:
As it's autosize, an empty bitmap might keep fixed size.
Couldn't find working example of that.
MrBcx:
https://stackoverflow.com/questions/46272931/how-to-get-comboxs-edit-control-handle-from-subclassed-comboxs-listbox
--- Code: ---Bottom line is that they are using a code snippet like this to obtain the edit control:
// Get the edit window handle to each combo box.
pt.x = 1;
pt.y = 1;
hwndEdit1 = ChildWindowFromPoint(hwndCombo1, pt);
When trying, I had to use pt.x= 5 pt.y= 5 but I then get a control of window class "Edit" that receives the keystrokes.
--- End code ---
Seems if you can get the "Edit" hwnd then resizing it could be accomplished several different ways.
DMac:
The simplest way to get the edit handle from a dropdown combobox.
HWND hEdit = FindWindowEx(hCombo, NULL, WC_EDIT, NULL);
Unfortunately you cannot resize the edit control though.
John Z:
Thanks everyone!
I appreciate the ideas and inputs. I'm going to try the empty bitmap idea from TimoVJL first, seems promising, then MrBCX which is (much) more involved, at least to me. If it comes down to DMac thoughts I guess I'll drop back to simulating a combo box with a edit and a dropdown list.
Thanks All,
John Z
Navigation
[0] Message Index
[#] Next page
Go to full version