Double click not

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DaleDewing
    New Member
    • Oct 2014
    • 6

    Double click not

    I have been having problems with double click event not triggering so I Did this test. It is a single form with one button that should open a msgbox if I double click on it. I never see the msgbox.
    Public Class Form1

    Private Sub ButtonDoubleCli ck_DoubleClick( sender As Object, e As EventArgs) Handles ButtonDoubleCli ck.DoubleClick
    MsgBox("You double clicked.")
    End Sub

    End Class

    Dale
  • DaleDewing
    New Member
    • Oct 2014
    • 6

    #2
    tried this too.
    Private Sub ButtonDoubleCli ck_MouseDoubleC lick(sender As Object, e As MouseEventArgs) Handles ButtonDoubleCli ck.MouseDoubleC lick
    MsgBox("You double clicked.")
    End Sub

    Comment

    • twinnyfo
      Recognized Expert Moderator Specialist
      • Nov 2011
      • 3664

      #3
      Why are you requiring your users to double-click a button? This is counter-intuitive to every other usage of buttons.

      Additionally, in most cases, command buttons cannot differentiate between a click and a double click, so if you already have a sub attached to the click event, that will always fire first--regardless of how quickly the user can double-click.

      Comment

      • DaleDewing
        New Member
        • Oct 2014
        • 6

        #4
        I agree that you would normally not double click on a button. I was actually originally having a problem where on a secondary form I needed a double click on an item in a listbox and it would work the first time I opened the form but if I closed the secondary form and went back to the mainforn and then opened the secondary form again double click would not work. On a microsoft website they used a button to demonstrate double click. So I tried it as a test and it would not work. What I posted is the total code on the form.

        Dale

        Comment

        • twinnyfo
          Recognized Expert Moderator Specialist
          • Nov 2011
          • 3664

          #5
          Sorry, Dale! Wish I had more information on this one. It looks like everything is correct in your first block of code. I wonder what is preventing the code from firing....

          Comment

          • DaleDewing
            New Member
            • Oct 2014
            • 6

            #6
            Sorry for the confusion. On more searching on the internet found another microsoft websight that says a Button does not raise a double click event. I will have to do more research on my original problem. Thanks for your help.
            Dale

            Comment

            • twinnyfo
              Recognized Expert Moderator Specialist
              • Nov 2011
              • 3664

              #7
              Well, before we totally scrap the idea, let's take a look at what you are trying to do, and see if we can come up with an alternate solution.

              In MS Access, a Command Button can use a Double-Click event--but only if there is no Click event also associated with that button.

              I'm sure we can come up with some ideas for your vision....

              Comment

              • DaleDewing
                New Member
                • Oct 2014
                • 6

                #8
                Found my problem. I didn't realize that if you close a second form and then open it again it remembers its variables. When I went to the second form again I had a mouse down event enabled for a drag and drop. This seemed to disable double click.

                Dale

                Comment

                • twinnyfo
                  Recognized Expert Moderator Specialist
                  • Nov 2011
                  • 3664

                  #9
                  Glad you found out the problem. Hope to see you here again some time!

                  Comment

                  Working...