-
I would like to change the forecolor of a label when a user passes over it, and return it to the my old color when they get off it...is this possible?(i think ive seen this before is all)
also anyone have an idea why the numbers 1-4 above the letters on my keyboard don't work?(i used numpad to show those incase you wondered)
-
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'SET DEFAULT FORECOLOR
Label1.ForeColor = &H8000000F
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'SET DESIRED FORECOLOR
Label1.ForeColor = H80000012&
End Sub
-
SetSysColor API
You can use the SetSysColor API to change all your Windows System Color.
If you need the sample program that I've written to change all the system color, then just email me & I'll send it to you.
Code:
Option Explicit
Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
Const COLOR_INFOTEXT = 23
Const COLOR_INFOBK = 24
Private Sub Form_Load()
'This will change the ToolTips background color to Blue Colour
'and ToolTips text to Red Colour
SetSysColors 1, COLOR_INFOTEXT, vbRed
SetSysColors 1, COLOR_INFOBK, vbBlue
End Sub
-
is there any kind of "mousemoveoff" sub?
-
I don't think there is..but put the change the labels color by putting the code in form_move or any command you want.
-
This code checks if the Mouse is on the Control or not.
Code:
If X < MyControl.Left Or X > MyControl.Width Or Y < MyControl.Top Or Y > MyControl.Height Then...
-
have a look at 'SetCapture' and 'ReleaseCapture' API calls at http://www.vbapi.com. using these functions you could easily implemet MouseEnter and MouseExit events.
best regards
Sascha