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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top