newbie C# Clicked event not firing

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

Hi All,
In a C# Windows project, My clicked event code did not
fire. First I had to actaully declare the method rather
than just adding the code and then in the
InitializeComponent I had to add:
this.button1.Click += new System.EventHandler
(button1_Click);
So that the event would run.

In vb.net this seems to be generated automatically. Do I
have a setting turned off somewhere in Visual Studio?

tia
Randy
 
Hello,

Randy said:
In a C# Windows project, My clicked event code did not
fire. First I had to actaully declare the method rather
than just adding the code and then in the
InitializeComponent I had to add:
this.button1.Click += new System.EventHandler
(button1_Click);
So that the event would run.

In vb.net this seems to be generated automatically. Do I
have a setting turned off somewhere in Visual Studio?

You can create the handler by pressing the flash button of the properties
window and selecting the event you want to create the handler for.

HTH,
Herfried K. Wagner
 
Back
Top