The use of #region

  • Thread starter Thread starter Dom
  • Start date Start date
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
 
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.
 
Back
Top