Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    On Mouse Move (2002)

    I have 16 text boxes on a form with attached label. I have the function below that runs in the On Mouse Move event of the text box, it works well except one problem. The last label stays bold and underlined when the mouse is somewhere else on the form. How can I reset the properties if the mouse is over another part of the form? Any help is appreciated.

    Private Function HandleFocus(intBtn As Integer)
    ' This function is called when a menu option receives the focus.
    ' intBtn indicates which button was clicked.

    Dim intOption As Integer

    'On Error GoTo HandleMouseOver_Err

    For intOption = 1 To 16
    'Show that this menu option has the focus...
    If intOption = intBtn Then
    Me("Label" & intOption).FontBold = True
    Me("Label" & intOption).FontUnderline = True
    '... and turn off the focus on the other options
    Else
    Me("Label" & intOption).FontBold = False
    Me("Label" & intOption).FontUnderline = False
    End If
    Next intOption



    HandleMouseOver_Exit:
    Exit Function

    HandleMouseOver_Err:
    MsgBox "There was an error executing the command.", vbCritical
    Resume HandleMouseOver_Exit

    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: On Mouse Move (2002)

    In the On Mouse Move event of the section that contains the text boxes (presumably the detail section), enter

    =HandleFocus(0)

    This will attempt to bold Label0 and unbold Label1 through Label16. (If you happen to have a Label0 control, replace 0 with any integer without a corresponding label)

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: On Mouse Move (2002)

    I looked at the form events and didn't the on mouse move event. Never thought to check the section. Thanks Hans,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •