Place a Lable on a Form and paste the code for a demo:
VB Code:
Option Explicit Dim blnToggleColour As Boolean Private Sub Label1_DblClick() 'Whatever End Sub Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If blnToggleColour = False Then Me.Label1.BackColor = vbRed 'Set the Flag blnToggleColour = True End If End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If blnToggleColour = True Then Label1.BackColor = &H8000000F 'Default colour 'Reset the Flag blnToggleColour = False End If End Sub
Please note that this method isn't bullet proof...
Bruce.




Reply With Quote