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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mouse over on a label 2

Status
Not open for further replies.

Nuqe

Technical User
May 6, 2003
57
CA
I'm looking to make a label change if the mouse is moved over it... ex) change forecolor, and possibly the mouse pointer to indicate that the user can click the label. i'm sure this can be done, possibly easily, but i dunno how, so i'm askin for some info
thanks a bunch
Nuqe

We all know about the "stupid user" don't we... :)
 
The easiest way that I can think of is to place the following code in the respective label events.

Private Sub Label1_Click()
' code for click event here.
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbBlue
End Sub

Now you still need to change the forecolor property back, so you can place the following code in the forms mousemove event (or whichever control contains the label).

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbButtonText
End Sub


Thanks and Good Luck!

zemp
 
Just to add to the post, for the MousePointer just set that property to anything other than 0-Default in the labels property window.
 
Thanks guys, it was simple... your examples worked like a charm.
thanks again
Cheers!!

NUQE

We all know about the "stupid user" don't we... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top