Classes with Events

  • Thread starter Thread starter Brett Hewitson
  • Start date Start date
B

Brett Hewitson

I have created a class that contains events. I have declared an instance of
the class in a form so that the form can react to the events of the class.

I have noticed that when a control is dropped onto a form, you are able to
create event stubs by changing to the events tab on the properties sheet and
typing in the name of the method etc.

I am at a loss as how to add the event subs of the class in without typing
it in manually.

Can anyone tell me how to create the stubs for the events of the class
automatically?

Thanks for any help.
Brett
 
Hi Brett,


You'll have to manually type them in matching the signature for the event
delegate. How do you know? Look at the code that attaches the event and see
which delegate is used and then look up that delegates signature.

In most cases event signatures are:

protected void SomeEvent(object sender, EventArgs e)
{
}

Other than using the VS.Net and double clicking I don't think there's
another easy way to do this...


+++ Rick ---


--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/blog/
 
Back
Top