Re: Format C# Braces in IDE?



clintonG wrote:
> Visual Studio 2005 has lost settings for C# braces and I can't figure
> out how to restore as indicated...
>
> Page_PreInit
> { // inline as indicated
> // indented
> } // inline as indicated

Tools->Options, select Text Editor->C#->Formatting in tree pane. There are
several suboptions under Formatting that affect how C# code is formatted.
For your example, you would need to:

1. Check all options under New Lines->New line options for braces.
2. Check "Indent block contents" under Indentation and uncheck "Indent open
and close braces".

If these are set correctly, it's possible that your code contains a
syntactic error that is confusing the formatter. Verify that it compiles
correctly, and that nothing appears to be highlighted with the wrong color.
Please write back if this doesn't solve your problem.
--
Derrick Coetzee, MCP, MSFT (Speech Server)
This posting is provided "AS IS" with no warranties, and confers no
rights.


.



Relevant Pages

  • Re: Coding standards
    ... variables and the C idiom that was established with the C standard library. ... There's no need for any braces ... with spacing used to make a nested parameter ... >> I know almost nothing about the `indent' utility. ...
    (comp.lang.c)
  • Re: oscillator
    ... Read other peoples code and learn to indent and use your ... braces clearly and consistently. ... consistent. ... As to level of understanding, I don't profess to be a C expert or I ...
    (comp.lang.c)
  • Re: Braces or not [Re: cat]
    ... BUT - it is appreciably harder to remember to add them later on ... I used to actually always put the braces in. ... placing the cursor in the new linedirectly under the 'l' from while, ... so new indent is done, ...
    (comp.lang.c)
  • Re: strcpy warning
    ... > habit I picked up from Perl, which requires the braces, but I find it ... indent the body a full level. ... have a harder time with other people's code than I might if I just ... so I might as well be consistent. ...
    (comp.lang.c)
  • Re: Turn off auto format
    ... what you just described is not "auto formatting". ... formatting for table justification and column width. ... What you are looking for is called a "Hanging Indent" - to apply it, ...
    (microsoft.public.mac.office.word)