CheckBoxes in VB6

thatbox

Senior member
Dec 5, 2002
253
0
76
I need CheckBoxes that have an extra state: X. The default CheckBoxes can only be checked and unchecked -- is there another object designed for this? I'm a semi-noob in VB, sorry. Any help will be greatly appreciated!
 

calpha

Golden Member
Mar 7, 2001
1,287
0
0
If you're looking for tri-state check boxes where one is checked, one is not, and the other is grayed over (like in an installation package where you install some of a products sub features but not all), then vb's current checkbox control will not support this by default, at least not in my current memory ;)

You can get it to do what you want, but it'd be tricky. If you're a semi-noob in vb, I wouldn't recommend trying it You'd have to subclass the WM_PAINT and WM_CLICK messages to get it to do what you want as well as use a module level variable. www.vbaccelerator.com has an excellent subclassing dll that'd work perfect. But you'd have to figure out how to do the rest of it on your own. It'd be a combination of a subclassed & owner drawn control.

BTW--if you don't know what subclassing is----you intercept teh default windows messages to a control to apply your own behavior for those messages instead of using the controls' default responses to those messages. Again, if you're new to VB, I wouldn't recommend this way.

The other alternative is 3rd party controls---i'm sure there's some out there that support what you're looking for.

 

thatbox

Senior member
Dec 5, 2002
253
0
76
Actually, VB6 does support checked, unchecked, and greyed, but unfortunately a user can't grey a box by clicking twice. I've seen these things before, with blank, checked, and xed (an X instead of a check). I can imagine how you'd do it with heavy programming (lots, including making a few pictures of a box with an X to display after the two clicks, right?) but I'm just not there yet. Any idea where I could find a good index of third party controls to look through?
 

igowerf

Diamond Member
Jun 27, 2000
7,697
1
76
I can imagine how you'd do it with heavy programming (lots, including making a few pictures of a box with an X to display after the two clicks, right?) but I'm just not there yet.

You can just use the image object and change the pictures OnClick().