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/
 

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

Similar Threads

GUI - class - dataclass 1
Interface class with event 13
struggling with events 4
how to add event to class 8
events used in .NET framework 7
Use of event handling 6
event and delegate 1
about events and delegate 2

Back
Top