If you're going to be using alot of these "Hover" Labels then you'd be better off making a Control or using a Class, e.g.
In a Class Module, Named: HoverLabel..
In a Module..Code:Public WithEvents Label As Label Private Sub Label_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If TypeName(oLastLabel) = "Nothing" Then Set oLastLabel = Label Label.ForeColor = vbBlue Label.FontUnderline = True End If End Sub
In a Form with 3 Labels..Code:Public oLastLabel As Label
Code:Private Link1 As New HoverLabel Private Link2 As New HoverLabel Private Link3 As New HoverLabel Private Sub Form_Load() Set Link1.Label = Label1 Set Link2.Label = Label2 Set Link3.Label = Label3 End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If TypeName(oLastLabel) = "Nothing" Then Exit Sub oLastLabel.ForeColor = vbWindowText oLastLabel.FontUnderline = False Set oLastLabel = Nothing End Sub Private Sub Label1_Click() 'Play Code to Jump to URL in Label1 Here.. End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]




Reply With Quote