mouseover effect on command buttons
VB Code:
Private Declare Function ReleaseCapture Lib "USER32" () As Long Private Declare Function SetCapture Lib "USER32" (ByVal hwnd As Long) As Long Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) ' will change the background color for the command button With Command1 If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then ReleaseCapture Command1.BackColor = &HE0E0E0 Else SetCapture .hwnd Command1.BackColor = vbWhite End If End With End Sub Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) ' will change the background color for the command button With Command2 If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then ReleaseCapture Command2.BackColor = &HE0E0E0 Else SetCapture .hwnd Command2.BackColor = vbWhite End If End With End Sub




Reply With Quote