Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB code to change label back color

Status
Not open for further replies.

TheunsGoosen

Technical User
Jan 17, 2007
36
GB
(Access beginner)
Hi,

I assigned an event procedure to a label and its working perfectly. The label appears on a switchboard and it would be nice if the label back color could change on mouse moving over it. But I’m unsure about the VB code.

Private Sub Label82_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

?

End Sub


Thanks
TC
 
Assuming the label back color starts out as black, this changes the back color to white:

Code:
Private Sub Label82_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label82.BackColor = vbWhite
End Sub

and don't forget, you have to change the color back to the original (black in this case) when the mouse moves off of the label:

Code:
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label82.BackColor = vbBlack
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks for the help it works,
The label is changing when I’m mouse move over the label but I’m struggling to get the label color back to its original color once the mouse moves away from the label.
 
Sorry my mistake, i see now that the detail_mousemove is taking care of it.

Thanks for the help

regards
TC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top