adding event handlers for windows controls

  • Thread starter Thread starter Peter Foot [MVP]
  • Start date Start date
P

Peter Foot [MVP]

From the Form designer with the Property pane visible, click the Events
button (lightning strike). This will show the supported events on the
selected control. You can double click a blank event here and have the
method created and hooked up for you.

Peter
 
Is there an easy / automatic way to add new events & handlers to a C# CF app
form designer?

If I double click on a control in the form designer it will open the code
window and automatically add the event handler and delegate but only for the
default control event. Is there a way I can force VS to create other events
such as the key down event without having to add it manually?

Thanks
Joanne
 
Joanne:

In VB.NET, you can click on the combo box in the upper right hand corner of
the app and it will list them for you. In C# you need to go into the
properties window and look for the yellow lightning bolt. In both places
you'll find a list of available events.

Also note that you may be able to add handlers for many events b/c they
inherit from Control. HOwever, just b/c those events are there and compile,
that doesn't mean they'll actually fire. The click event of a label
coontrol comes to mind.

HTH,

Bill
 
Back
Top