473,750 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Visual Studio Formatting: how to anchor nested statements

20 New Member
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 1438
tlhintoq
3,525 Recognized Expert Specialist
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 Recognized Expert Specialist
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
matthewaveryusa
20 New Member
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
1950
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 view then the changes in the code page are lost. I searched around and found that there was a patch for Visual Studio .Net 2002 referenced by Microsoft Knowledge Base Article - 324199. I tried to load this patch but of course it won't patch 2003....
0
1074
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" whenever I try to do so. This problem occurs on my laptop but not on my desktop, therefore appearing to be machine or setup specific. I can make changes to the anchor settings on my desktop and they appear OK when exported to my laptop, but I still...
1
8011
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 under 2002) Create a form and add two buttons (bottom right) and a panel (fill the top of the form) Anchor the buttons to the bottom right and anchor the panel to top bottom left and right. set all three controls access level to protected
7
1308
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")%>' runat=server>some link</a> Looks pretty straight forward, but when I add the runat=server property it stops parsing the <% %> block correctly.
8
1779
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 spammed by this so-called Microsoft MVP that gave me a very vague answer, followed by a series of incorrect answers that I had already mentioned were tried, tested and failed. Sorry I had to start my post like that : - ) but here goes my actual...
6
4857
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 honest. And I don't believe Microsoft has purchased Dreamweaver to do their designs. Are any of you using Visual Studio exclusively to develop your ASP.net apps? If so do you have any web sites that can demonstrate the result. I am really curious...
13
1361
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 like to do is have extra spaces taken out or added in where appropriate. I can do this in vb, but am having problems with c#.
81
4563
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 less virtual memory. Are other people experiencing this same problem?
0
7334
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 beginning CIS student who is struggling to get their programs working. I work in the computer lab at the college I'm attending and I see many students who don't know how to use the IDE for best results. Visual Studio automatically creates a number of...
0
8839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9584
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8265
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6811
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2227
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.