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

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
 
J

joecool1969

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.
 
B

Billy

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?
 
J

joecool1969

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.
 
B

Billy

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.
 
J

Jeff Johnson

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.
 

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

Top