How to select FormClosing event in C# code window like in VB.NET

  • Thread starter Thread starter Billy
  • Start date Start date
B

Billy

Hello!

I'm learning C# and I came to a problem with events. I know how to do
that in VB.NET but look like in C# is different approach.

If I in VB.NET double click on Form I automatically get new method
Form1_Load in Code window. Then I select in top left ComboBox instead
"(General)" item "(Form1 Events)" and then I can easy select in right
ComBox event I would like to choose, in my case FormClosing.

How can I do the same in C#? I know that I can select event in design
view in Properties window with Events Button and then double click to
create that event. But how to do that in Code window?

Thanks,
Billy
 
Hello!

I'm learning C# and I came to a problem with events. I know how to do
that in VB.NET but look like in C# is different approach.

If I in VB.NET double click on Form I automatically get new method
Form1_Load in Code window. Then I select in top left ComboBox instead
"(General)" item "(Form1 Events)" and then I can easy select in right
ComBox event I would like to choose, in my case FormClosing.

How can I do the same in C#? I know that I can select event in design
view in Properties window with Events Button and then double click to
create that event. But how to do that in Code window?

Select the Form. Just above the Properties sub-window there is a
toolbar button whose icon looks like a lighting bolt. Click it. Find
the event you want to make a handler for and double click on it.

Double clicking on the control will create an event handler but just
the one for the default event for that control.
 
Select the Form. Just above the Properties sub-window there is a
toolbar button whose icon looks like a lighting bolt. Click it. Find
the event you want to make a handler for and double click on it.

Double clicking on the control will create an event handler but just
the one for the default event for that control.

Yes, that approach I know but how to do that in Code window, like you
can do that in VB.NET? Is that not possible?
 
Yes, that approach I know but how to do that in Code window, like you
can do that in VB.NET? Is that not possible?

Nope. There are numerous differences in the form and manner of the IDE
window when editing a VB project member and a C# project member, and
that is one of them. You're just gonna have to live with it. I think
that when you weigh in all the differences, the IDE is way more
friendly with C# than VB.
 
Nope. There are numerous differences in the form and manner of the IDE
window when editing a VB project member and a C# project member, and
that is one of them. You're just gonna have to live with it. I think
that when you weigh in all the differences, the IDE is way more
friendly with C# than VB.- Hide quoted text -

- Show quoted text -

Thanks for your time and answer Joe.
 
Nope. There are numerous differences in the form and manner of the IDE
window when editing a VB project member and a C# project member, and
that is one of them. You're just gonna have to live with it. I think
that when you weigh in all the differences, the IDE is way more
friendly with C# than VB.

I agree. Granted, the drop-down thing for events is a really nice feature of
VB, but even with the enhancements to Intellisense they made in VS 2008 for
VB, the C# IDE experience is still better overall. It's a pity, really, as
it perpetuates the impression that VB.NET is a second-class citizen.
 
Back
Top