Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

HI,

 

Please tell me how i could write the events for the controls in c#.net

In VB.net all the events corresponding to the control are shown in the IDE where as in c#.net those events are not visiible in the IDE.

 

Even if i wrote the event manullay it does not detect the functionality.

I request some one to please clarify my query.

 

Thank you,

  • Administrators
Posted

Easiest way is in the IDE bring up the property windows (F4 by default).

You should see a button on the property window that looks like a yellow zigzag thing, click this and you will see the controls events - just double click the event in question.

 

The reason adding them in code doesn't work is you also need to associate the event handler with the event.

e.g.

 //given the following event handler
 private void button1_Click(object sender, System.EventArgs e)
         {
         
         }
 
 //the following code would need to be executed to associate them together
     this.button1.Click += new System.EventHandler(this.button1_Click);
 

 

using the IDE will automatically do this for you though.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...