Sub AddNewDoubleClickButton()
Dim b As New doubleclickbutton
AddHandler b.DoubleClick, AddressOf Button_DoubleClick
Me.Controls.Add(b)
End Sub
Class doubleclickbutton
Inherits Button
Public Sub New()
SetStyle(ControlStyles.StandardClick, True)
SetStyle(ControlStyles.StandardDoubleClick, True)
End Sub
End Class
Private Sub Button_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox("double-click")
End Sub
OK so now I am confused. How can I simple double click event be so hard?
No. You have to do as the code example in post 3, refer documentation for Button.DoubleClick event.won't that work ????
No. You have to do as the code example in post 3, refer documentation for Button.DoubleClick event.
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Try
If Me.WebBrowser1.Document.Window.Frames("paginaCentral").Document.Body.InnerHtml.Contains("Try again") Then
Timer1.Enabled = False
Button1.PerformClick()
End If
Catch ex As Exception
End Try
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.WebBrowser1.Document.Window.Frames("paginaCentral").Document.All("captchaDisp-UICaptcha-reloadButton").InvokeMember("click")
End Sub
Adicione um sub público PerformDoubleClick à classe Doubleclickbutton onde você chama o método protegido OnDoubleClick (passando EventArgs.Empty).