The use of #region

D

Dom

I'm teaching myself C#, was a very experienced VB programmer. I like
the #region thingy, but I try to keep all the events in a single
region, like #region EVENTS. The problem is C# adds the events in the
order in which you create them, unlike VB which used to sort them. So
if I create a #region EVENTS area, the new events are created outside
this.

Is there a way around this?

Dom
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Dom said:
I'm teaching myself C#, was a very experienced VB programmer. I like
the #region thingy, but I try to keep all the events in a single
region, like #region EVENTS. The problem is C# adds the events in the
order in which you create them, unlike VB which used to sort them. So
if I create a #region EVENTS area, the new events are created outside
this.

Is there a way around this?

NO that I know of.

If you think about it, the designer has no way to know how you want to
organize your members.

The best way around this is design the interface first, create all the
events you need and only then move the methods around.
 

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