Is there anyway to get CSharp to auto-format like VB.NET?

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

I like some of the auto-formatting features of VB.NET (god help me) but I
really prefer to use CSharp (C#) is there any way to get the features of
auto-indenting, auto-capitalization, and advanced intellisense like VB does?
 
Aaron said:
I like some of the auto-formatting features of VB.NET (god help me) but I
really prefer to use CSharp (C#) is there any way to get the features of
auto-indenting, auto-capitalization, and advanced intellisense like VB
does?

Yes, visual studio has the auto-indenting and advanced intellisense. Check
Tools > Options > Text editor > All Languages.
 
Yeah, it just does not auto-indent. I type in a new variable and hit enter
and nothing.

private void blah(object sender, FileSystemEventArgs e)

{

MessageBox.Show("yo");

string doesntindent;



}
 
It works a little differantly. If you go to your line where the last
semicolon is and press enter it will create a new line and that line
will start at the same indentation as that line. VB has this advantage
and there are others but you can design a cleaner app with C# from and
Engineering or OOP/OOD stand point. It will also do some auto
formatting if you add you last brace after you have coded your scoped
code.

Wiz
 
Aaron said:
Yeah, it just does not auto-indent. I type in a new variable and hit enter
and nothing.

private void blah(object sender, FileSystemEventArgs e)

{

MessageBox.Show("yo");

string doesntindent;



}


Try this..

go to the end of the file and find the last curly brace..

Delete it, then re add it.. it will format your entire page..

Paul
 
Aaron said:
I like some of the auto-formatting features of VB.NET (god help me) but I
really prefer to use CSharp (C#) is there any way to get the features of
auto-indenting, auto-capitalization, and advanced intellisense like VB does?
There is a shortcut that will format selected code
CTRL+A (Select all code) CTRL+K, CTRL+F
This should autoformat all code in the current window.

HTH
JB
 
Back
Top