Toggle button colour

B

bilbo+

Hi there, i have a yes no option on my form, which so far i have as a toggle
button, is there any way i can make it go a certain colour when it is on
indicating a yes and another when it is off indicating a no?
 
F

freakazeud

Hi,
you could format the fore color on the on click event of the toggle button
e.g.:

If Me.Toggle = True Then
Me.Toggle.ForeColor = vbRed
Else
Me.Toggle.ForeColor = vbBlack
End If

If you want to change the back color you might need to work with labels and
adjusting their color or use two images...!
HTH
Good luck
 
B

bilbo+

Yeah its not really working how i want it to, is there any other way i can
get it to clearly show whether it has been toggled yes or no, I just need to
be able to tggle someting on or off which i can get to show up either as the
actual toggle or something else which is clearly visable so that when lookign
at the data you immediately know whether it has or hasnt got a signed
contract... any suggestions?
 
K

Klatuu

Either create or find two .bmp pictures you like. One for Yes, the other for
no.

Make the no picture the Picture property of the toggle button
Put something like this in the After Update event of the toggle button
Private Sub Toggle8_AfterUpdate()
If Me.Toggle8 = True Then
Me.Toggle8.Picture = "C:\SomePath\yes.bmp"
Else
Me.Toggle8.Picture = "C:\SomePath\no.bmp"
End If

End Sub
 
Top