views:

53

answers:

2

hi,

when coding in Visual C# Express 2008 you can expand/collapse code segments using the +/- symbols on the left hand corner of the text-editor. These appear automatically when a function is created.

Is their anyway i can manually add a expand/collapse point to a code segment.

+2  A: 

Yes, you can define a region manually

#region myRegion
// your collapsible code here
#endregion
mbmcavoy
I slightly changed the code to have "endregion" instead of "end region"
Eilon
thanks,the keyboard shortcut after highlighting the code is ctrl+K, ctrl+S, #re and then hit enterafter that change the namecheers :)
tecno
Thanks for the fix, Eilon! If it wasn't for good IDE editors, my code would never compile... :)
mbmcavoy
+1  A: 
#region Any region name goes here

... code goes here ...

#endregion

Note that the #endregion has no space in it.

Frode N. Rosand