What event for "HOVER"

grnzbra

Registered User.
Local time
Today, 14:31
Joined
Dec 5, 2001
Messages
376
I ran across a database with a switchboard that had buttons with labels. Any time the cursor was over either a label or its button, the label's font would be bolded and when the cursor was moved away, it would return to normal. I never got a chance to look at the code.

In vb2005 express, there are MouseEnter and MouseExit events, but I don't see any events like this in VBA. Does anyone have any idea of what event could be used to accomplish this?
 
my database does that, this code is what does it. let me know if you have questions.

Code:
Private Sub but6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call ButtonOver("but6")
End Sub

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call CheckButtonState
End Sub

Public Sub CheckButtonState()
    If Not bButtonsReset Then Call ResetButtons     'reset buttons if they're not reset yet
End Sub

Public Sub ResetButtons()
    For Each ctl In Me.Controls
        If ctl.Name Like lbl & "*" Then
            ctl.SpecialEffect = 0
            Me.Controls(ctl.Name).Caption = ""
        End If
    Next ctl
    bButtonsReset = True                            'set the button state
End Sub


Public Sub ButtonClick(CtlName As String)
    Me.Controls(CtlName).SpecialEffect = 2
    Sleep 0.1
    Me.Controls(CtlName).SpecialEffect = 3
    DoEvents
    bButtonsReset = False
End Sub

Public Sub ButtonOver(CtlName As String)
    If Not (Me.Controls(CtlName).SpecialEffect > 0) Then
        Call ResetButtons
        Me.Controls(CtlName).SpecialEffect = 3
        bButtonsReset = False
    End If
End Sub
 
Use this link and scroll down to "Soft Command Buttons" in the MS Access 97 area almost at the bottom.
 

Users who are viewing this thread

Back
Top Bottom