Double Click Event not fire

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a vb .net program

Public Class Testing
Inherits System.Windows.Forms.Form

<STAThread()> Shared Sub Main()
System.Windows.Forms.Application.Run(New HelloWorld())
End Sub

Public Sub New()

MyBase.New()
Me.Text = "Testing"
Me.AutoScale = False
Me.StartPosition = FormStartPosition.Manual
Me.MaximizeBox = False
Me.FormBorderStyle = FormBorderStyle.FixedToolWindow

End Sub

Private Sub Form1_DoubleClick(sender As Object, ByVal e As System.EventArgs) Handles MyBase.DoubleClick
do_something()
End Sub


The do_something() is not raised when I double click the form ...

Any Idea, Thank You
 
Hi, You are trying to handle an event from the base class, and that might be
the cause of your problem most probably. You can handle events raised on the
current form.

--
Rami Saad
Microsoft GTSC Developer support for Middle East


GroupMan said:
I have a vb .net program

Public Class Testing
Inherits System.Windows.Forms.Form

<STAThread()> Shared Sub Main()
System.Windows.Forms.Application.Run(New HelloWorld())
End Sub

Public Sub New()

MyBase.New()
Me.Text = "Testing"
Me.AutoScale = False
Me.StartPosition = FormStartPosition.Manual
Me.MaximizeBox = False
Me.FormBorderStyle = FormBorderStyle.FixedToolWindow

End Sub

Private Sub Form1_DoubleClick(sender As Object, ByVal e As
System.EventArgs) Handles MyBase.DoubleClick
 
* "Rami Saad said:
Hi, You are trying to handle an event from the base class, and that might be
the cause of your problem most probably. You can handle events raised on the
current form.

Mhm... The designer adds the handlers for the base class's events too.
 
Override the OnDoubleClick method. It is the prefered way of handling events in inherited forms...

regards,
 
Back
Top