building a new component

dnldldrch

New member
Joined
Aug 18, 2006
Messages
1
Programming Experience
Beginner
I would like to build a new component combining a combobox and a checkbox. The result would be a list of checkboxes within a combobox.
I only need a start on an example I can work from to get me going. I have looked but can not find a solution similar to what I am trying to do.
 
You can do this with some subclassing, but it's not an easy one. You can't physically add checkboxes to a dropdown portion of a combobox so it will involve some custom painting. You need to start by subclassing a normal combobox...

VB.NET:
Expand Collapse Copy
Protected Overrides Sub WndProc(By ref m as system.windows.forms.message)
 
End sub.

In there you will need to check for a WM_CTLCOLORLISTBOX message, and then you will need to check the wParam to get the handle of the dropdown window. From there you will paint your items, and do all the hittesting logic.
 
Back
Top