Link to home
Start Free TrialLog in
Avatar of UdoG
UdoG

asked on

Automatic Triple State Checkbox

How can i get a Automatic Triple State Checkbox in VB 5
Changing the Style with SendMessage(ChkBox.hWnd,BM_SETSTYLE,BS_AUTO3STATE,1) will not work in VB 5
Avatar of wj7ster
wj7ster
Flag of New Zealand image

Set the check box's 'Value' property to one of the following:

Check1.Value = vbUnchecked ' 0
Check1.Value = vbChecked   ' 1
Check1.Value = vbGrayed    ' 2

I hope this is what you want.
Avatar of UdoG
UdoG

ASKER

I knew that i can change the value per code.
I want the 3 states change automatic by clicking on the checkbox.

That won't work as the CLICK event is disable when the box is greyed. If you try to do something like:

sub Check1_Click()
temp = check1.value
temp = temp + 1
check1.value = temp mod 3
end sub

It'll crap out when temp = 2 as the CLICK event stops firing.

Avatar of UdoG

ASKER

With this code i create a newer ending loop.
Because the line check.value = x send the click event again

Like I said, it ain't gonna work 'cause there's no way out once it's *GREYED*!

Avatar of UdoG

ASKER

OK, but this won´t help me.
ASKER CERTIFIED SOLUTION
Avatar of clifABB
clifABB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial