473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Visual Studio Formatting: how to anchor nested statements

Hi,
This is a simple question.
How do I get statements that are nested (so like an if statement inside an if statement) to have the little +/- button so I can collapse it?

thanks,
Matt
Oct 2 '08 #1
3 1427
tlhintoq
3,525 Expert 2GB
I don't think the if statement structure is collapsible.
You can however surround any section of code with #region and #endregion to create a collapsible section.

I tend to keep everything collapsed in a file (control-m, control-o) then only open the part I am working at the time.

If you do something like this...

#region Parse String
... some cool code here
#endregion

#region Rotate Photo
... my nifty routine
#endregion

Each collapsed area will be shown with the region name in grey. Makes it pretty easy to follow the logic of the overall design then concentrate just on the part that interests you at the time.
Oct 2 '08 #2
Curtis Rutland
3,256 Expert 2GB
That's exactly what I'd suggest. What I usually do in my code is make regions for private members, public members, public properties, constructors, event handlers, public methods, and private methods, assuming I need all of them.

That way, everything stays organized.
Oct 2 '08 #3
Thanks guys, That's what I've been using for the past month and it works quite well.
Oct 21 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: chris mancini | last post by:
I have recently installed Visual Studio .Net 2003 and have noticed that there are problems with formatting in the HTML code page. If I format the HTML the way I want and navigate back to design...
0
by: PJ | last post by:
I am using Visual Studio .Net 2003 and I am unable to alter the anchor settings of any control, receiving the message "Invalid property value. Cannot widen from target type to primitive type"...
1
by: Jason Hickey | last post by:
Has there been a change in the way the UI designer handles winform inheritance in the 2003 version of visual studio. Consider the following (try it if you are using 2003 Everything seems to work...
7
by: neverstill | last post by:
hi- I have <a> tags in my DataList. For the href property, I want to do something like this: <a href='~/Default.aspx?show=Support&disp=Faq&p=<%# DataBinder.Eval(Container.DataItem, "name")%>'...
8
by: Jacob Crossley | last post by:
Preface: Not to sound mean or arrogant, but please don't answer this question unless you have a specific and tested answer. I'm saying this only because I posted the same quesion earlier and got...
6
by: Marty U. | last post by:
I know this topic has been beat to death. However, I was sitting here trying to figure out what Microsoft Does when they develop an ASP.net for WYSIWYG functionality. Visual Studio's sucks to be...
13
by: sck10 | last post by:
Hello, I am trying to find the option VS2K5 that will automatically change HtmlMeta hm=new HtmlMeta(); or HtmlMeta hm = new HtmlMeta(); to HtmlMeta hm = new HtmlMeta(); What I would...
81
by: Peter Olcott | last post by:
It looks like System::Collections::Generic.List throws and OUT_OF_MEMORY exception whenever memory allocated exceeds 256 MB. I have 1024 MB on my system so I am not even out of physical RAM, much...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.