double click for button

hi,

i would to make my button to listen to double click event with the following code, but it seems does not work...or m i using a wrong method can anyone help me

Private Sub Button1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.DoubleClick
       MessageBox.show("It is a double click")
End Sub


thank you


Answer this question

double click for button

  • Deva_m

    I've tried your code but it doesn't work. I found that the new button will treat my single mouse click as 2 clicks. If I double click, I will get 4 click event instead of 1 double click event. What's wrong with that

  • SergoT

    i only using the double click event...there is nothing respond when i double click on the button, it there anything go wrong or there is no such double click event for button but why there is DoubleClick event allow to chose

  • Mark Magoo

    Try not to do anythin in 'Click' event.

  • Trevor Kelley

    First I would like to say that I don't remember when was last time when I saw a button that does something on DoubleClick Big Smile...

    Now if you really want to do "DoubleCick" on buttons you can do the following:

    1. Create a class that inherits from Button
    2. In the New sub add the following:


    SetStyle(ControlStyles.StandardClick, True)
    SetStyle(ControlStyles.StandardDoubleClick, True)

     


    Now use the new class instead of the Button class and it should work.

  • double click for button