Troy Mac
Nov 10th, 1999, 04:54 PM
Can anyone figure out why this does not work? I have four labels on the form and label1 works sometimes but the other ones will not change color until i click them I think there maybe something wrong with the SetCapture function it seems to bog things down. And most of the time nothing happens when I click Label1. It is supposed to show form2. Any Ideas
Thanks All
'module
Public Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long
'Code
Private Sub LblNewGame_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Put this in the mouse_move event of your control:
With LblNewGame
If Button = 0 Then
If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
ReleaseCapture
'Do your 'mouse-exit' stuff here
.ForeColor = &HFFFF00 '&H808000
' Else
SetCapture (hwnd)
' Do your 'mouse-enter' stuff here
.ForeColor = &HFFFF00
End If
End If
End With
End Sub
------------------
Troy MacPherson
Customer Suport Software Analyst
t_macpherson@yahoo.com
Thanks All
'module
Public Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long
'Code
Private Sub LblNewGame_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Put this in the mouse_move event of your control:
With LblNewGame
If Button = 0 Then
If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
ReleaseCapture
'Do your 'mouse-exit' stuff here
.ForeColor = &HFFFF00 '&H808000
' Else
SetCapture (hwnd)
' Do your 'mouse-enter' stuff here
.ForeColor = &HFFFF00
End If
End If
End With
End Sub
------------------
Troy MacPherson
Customer Suport Software Analyst
t_macpherson@yahoo.com