G
Guest
I’m having problems with a custom Combo box. The main problem is that I want
to modify the look of the combo which includes the size of the button. To do
this I have inherited from the standard combo set it as a UserPaint and
provided my own paint. This along with the standard Owner Draw for the list
items works fine for the DropDownList version, the problems start with the
versions with the edit box which are where the problems are.
So to get hold of the edit box so I can modify it I have subclassed it using
a NativeWindow class via a DllImported ComboBoxInfo method to get the edit
box Windows handle. After this I can resize the Edit box to fit (as I
resized the button) and to set the font to that of the main Combo box using
other DllImport methods (SendMessage, SetWindowPos etc). The problem is in
the edit box’s painting of its background… it doesn’t. If you delete text
the cursor moved but the text stays there and if you coved the combo box with
another Window and then switch back, the background if not repainted and the
covering Window graphics remain.
Anyone got any ideas? I do have a sample solution is anyone is interested.
to modify the look of the combo which includes the size of the button. To do
this I have inherited from the standard combo set it as a UserPaint and
provided my own paint. This along with the standard Owner Draw for the list
items works fine for the DropDownList version, the problems start with the
versions with the edit box which are where the problems are.
So to get hold of the edit box so I can modify it I have subclassed it using
a NativeWindow class via a DllImported ComboBoxInfo method to get the edit
box Windows handle. After this I can resize the Edit box to fit (as I
resized the button) and to set the font to that of the main Combo box using
other DllImport methods (SendMessage, SetWindowPos etc). The problem is in
the edit box’s painting of its background… it doesn’t. If you delete text
the cursor moved but the text stays there and if you coved the combo box with
another Window and then switch back, the background if not repainted and the
covering Window graphics remain.
Anyone got any ideas? I do have a sample solution is anyone is interested.