[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

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

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
rmmarsh
Asked:
rmmarsh
  • 3
  • 2
1 Solution
 
yesthatbobCommented:
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
 
rmmarshAuthor Commented:
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
 
yesthatbobCommented:
Not sure what to tell you there, using Format Document works for me...
0
 
rmmarshAuthor Commented:
Thanks anyway... I appreciate your time
0
 
rmmarshAuthor Commented:
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

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now