What is the usage of region in c#?
Give Examples about the Subject ,Please.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kunal VaishyaRank #990 · 2K reputationPosted Apr 29, 2014, 4:32 AM EDT
Example like this
#region Page Events
//do your code
#endregion
#region Controls Events
//do your code
#endregion
#region Utility
//do your code
#endregion
#region Procedures
//do your code
#endregion
VulpesRank #55 · 29.2K reputationPosted Apr 29, 2014, 4:44 AM EDT
http://msdn.microsoft.com/en-us/library/9a1ybwek.aspx
Abhay ShankerRank #375 · 6.7K reputationPosted Apr 29, 2014, 7:00 AM EDT
Regions are created in this format:
#region MyRegion
your code here
#endregion
you can also check below url for detail
http://msdn.microsoft.com/en-us/library/9a1ybwek.aspx
Joe WilsonRank #631 · 3.8K reputationPosted Apr 29, 2014, 8:43 PM EDT
Joe WilsonRank #631 · 3.8K reputationPosted Apr 29, 2014, 8:45 PM EDT
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Apr 29, 2014, 8:53 PM EDT
Joe WilsonRank #631 · 3.8K reputationPosted May 24, 2014, 9:10 AM EDT
Could you please explain region completely yourself?
Joe WilsonRank #631 · 3.8K reputationPosted May 24, 2014, 9:10 AM EDT
Could you please explain region completely yourself?
Joe WilsonRank #631 · 3.8K reputationPosted May 24, 2014, 9:11 AM EDT
Could you please explain region completely yourself?
VulpesRank #55 · 29.2K reputationPosted May 26, 2014, 3:24 AM EDT
You have to use it in Visual Studio to see how it enables you to collapse or expand a piece of code.
This is particularly useful when you want to avoid accidentally editing a piece of code which has been generated by the Visual Studio designer.
If you look at Form1.Designer.cs in a Windows Forms application, you'll see that the InitializeComponent() method has been collapsed in this way.
Bhabani PrasadRank #8,369 · 223 reputationPosted May 26, 2014, 4:07 AM EDT
Joe WilsonRank #631 · 3.8K reputationPosted Jun 13, 2014, 4:03 AM EDT
Joe WilsonRank #631 · 3.8K reputationPosted Jun 13, 2014, 4:05 AM EDT
Joe WilsonRank #631 · 3.8K reputationPosted Jun 13, 2014, 4:08 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jun 13, 2014, 6:06 AM EDT
What I meant is that you need to see it in action in Visual Studio to appreciate what it does. Just reading about it in a book or online is not enough.