Custom ComboBox Problem
-
I am creating a custom control in VB.NET that inherits from System.Windows.Froms.ComboBox. I am doing this so I can draw over the combo box to change it's appearance. To do the drawing I am overriding WndProc and capture the WM_PAINT message. I can draw the background with no problems, but the problem is with the selected text, as the base class draws an edit box on top for this. When I want to set the enable property to false, the text and background is always grey. I need to be able to change the colour of this when disabled. My other approach to this is to set a back color and not use the enabled property, but can't seem to override the OnClick event and cancel the event if another property is set to disable the control. Any advice on this matter would be greatly appreciated. Thanks J
-
I am creating a custom control in VB.NET that inherits from System.Windows.Froms.ComboBox. I am doing this so I can draw over the combo box to change it's appearance. To do the drawing I am overriding WndProc and capture the WM_PAINT message. I can draw the background with no problems, but the problem is with the selected text, as the base class draws an edit box on top for this. When I want to set the enable property to false, the text and background is always grey. I need to be able to change the colour of this when disabled. My other approach to this is to set a back color and not use the enabled property, but can't seem to override the OnClick event and cancel the event if another property is set to disable the control. Any advice on this matter would be greatly appreciated. Thanks J
I would suggest you go to this project and use it. It is a great combobox and is easy to work with. I also think it will let you do all of the things you are asking about. http://www.codeproject.com/vb/net/MultiColumnFlatCombo.asp It also has a 3D setting so don't let the title fool you.