Results 1 to 3 of 3

Thread: MSFlexGrid Events

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    88
    Howdy?

    How can I distinguish between Click and DblClick events? I mean every time you click a mouse, the Click event is fired up. Also, if you do double-click, the Click event will be fired up first and then DblClick event will be fired up later. Does it has any way to avoid Click event when want to use only DblClick event? Or any suggestions? Thanks in advance.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    treehouse
    Posts
    106
    That might be difficult to do but I do know the
    MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Event is fired before the both of them.

    I guess it depends on what you are trying to do. You might have to manipulate within these events to determine what you are trying to do.

    If there is anyway I can help let me know.


    bontyboy

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    One method would be to defer the Click event to a Timer giving you a chance to see if there is a follow up 2nd click, i.e.
    Code:
    Private bDblClick As Boolean
    
    Private Sub MSFlexGrid1_Click()
        'Defer the Event to the Timer, giving us time to make sure it's a single click
        'Alter this value to tweak sensitivity
        Timer1.Interval = 100
    End Sub
    
    Private Sub MSFlexGrid1_DblClick()
        'Indicate that this is a Double Click
        bDblClick = True
        MsgBox "Double Click"
    End Sub
    
    
    Private Sub Timer1_Timer()
        'Stop the Timer and if a 2nd Click hasn't been Detected then
        'Execute some Single Click code.
        Timer1.Interval = 0
        If Not bDblClick Then
            MsgBox "Click"
        End If
        bDblClick = False
    End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width