I'm a VB programmer trying to learn C#, and I'm having trouble doing the
setup for writing event procedures for built-in WinForms controls.

Here's an example:  I have a ComboBox control, and I want to write code for
the SelectedIndexChanged event.  With help from the list archives, I found
that I could go to the Events tab of the Forms Designer Property window,
and double-click on the SelectedIndexChanged event, in order to generate a
function with the correct signature.  So far, so good.

I know that I also have to generate a line in the form constructor like:
    this.cboName += new EventHandler(cboName_SelectedIndexChanged);

But how can I figure out what goes after the "new" keyword?  In other
words, how do I determine the appropriate built-in delegate type.  The way
I did it in this case was to look up the SelectedIndexChanged event in the
ComboBox members help article, and check the type of the event.  However, I
don't want to spend 3 to 5 minutes looking up the delegate type for every
event.

How are more experienced C# programmers hooking up events in a RAD
fashion?  I'm looking for a shortcut similar to (but hopefully
easier/quicker than) the one for getting the event signature.

This is so easy in VB 6.0 and VB.NET.

Bill

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to