How to indent csharp code in the vs2005

  • Thread starter Thread starter puzzlecracker
  • Start date Start date
something similar to ctrl-i in exclipse.

try

from menu Tools-> Options
From options dialog -> TextEditor -> C# -> formating -> indentation

-Cnu
 
01: Highlight code
02: Press TAB to indent or
03: SHIFT + TAB to unindent (or maybe CTRL)

I think CTRL+K+D formats.
 
There's probably a more direct way, but I'm lazy so...

One way to do it is to select the code you want auto-formatted, then cut  
it and immediately paste it right back where it was.  That is, just type  
Ctrl-X followed by Ctrl-V.  The default setting in VS is to auto-formaton  
paste.

I dare to suggest another shortcut... remove the last } and type it
again... the default settings for VS auto formats the code in the
{ and } block.

-Cnu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top