Toggle button colour

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top