How to create an icon combobox with edaitable textbox for windows forms

By Toshinobu Yamaguchi Dec 06, 2010
Windows Forms / custom controls tips
Creating DropDownList style icon combobox(not editable) is not difficult.
You just set DrawMode to OwnerDrawFixed or OwnerDrawVariable,
then hook up the MeasureItem and DrawItem events.

On the other hand, creating icon combobox with editable text box is really difficult.
Because .net framework don't allow changing margin of editable portion
of combobox, and overriding OnPaint method of combobox.

I found good sample code to create an icon combobox with editable textbox.
He use Win32API to solve the problems. It's tough work!
The sample code and DLL are for .NET 1.1.
However, I think this technique could be applied for .net 3.0/3.5.
Does anyone know the code written by .net 3.0/3.5?

If you are using my combobox, creating editable combobox is easy.
You just set DrawMode and TextLeftMargin propeties, hook up DrawItem event and override OnPaint method.


iconcombo.jpg
--
Toshinobu Yamaguchi

www.tosymsoft.comMultiLine ComboBox Control for Windows Forms

Personal Blog: http://www.tosymsoft.com/
COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs