Solved

Where is the setting in VS for IF statement brace position?

Posted on 2011-09-08
5
212 Views
Last Modified: 2013-11-26
I want to have my IF statement blocks braces on the same line as the IF statement... where is the setting to do this?

Fir example:

if(DateTime.Today() is "monday")  {  //  <----------    this is where I want the brace, not on the next line
    doSomething();
    doSomethingElse();
)
0
Comment
Question by:rmmarsh
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
yesthatbob earned 500 total points
ID: 36504866
Which version of VS? In VS2010, you would find it at:

Tools > Options >Text Editor > C# > Formatting > New Lines

From there,uncheck the "Place open brace on new line for control blocks" option. See this screen shot:

 Brace options
0
 

Author Comment

by:rmmarsh
ID: 36504977
That's what I have and it's not working... I do a Edit -> Advanced -> Format Document, and it doesn't change anything!

A bug maybe?
0
 
LVL 4

Expert Comment

by:yesthatbob
ID: 36505068
Not sure what to tell you there, using Format Document works for me...
0
 

Author Closing Comment

by:rmmarsh
ID: 36505081
Thanks anyway... I appreciate your time
0
 

Author Comment

by:rmmarsh
ID: 36505638
Found the problem... I was CHECKING the box, not un-checking it.  I just hate it when I do something dumb like that!

Thanks again!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with error in Query 2 38
How do I bind a WPF ComboBox to an ItemSource using XAML? 2 28
Open a link in vb.net 2 25
Adding items to a C# list incrementally 5 58
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question