Reputation: 464
I'm using Visual Studio 2005. It always wants to format switch statements like this:
switch (thing)
{
case A:
stuff;
break;
case B:
things;
break;
}
Is there a way to have it indent the cases like this?:
switch (thing)
{
case A:
stuff;
break;
case B:
things;
break;
}
Upvotes: 39
Views: 19985
Reputation: 55
An updated method of doing this, it's not too different.
Tools > Options > Text Editor > (Language) > Code Style > Formatting > Indentation > Indent case labels
Upvotes: 5
Reputation: 2857
Tools | Options | Text Editor | c# -> check 'Ident block contents' checkbox.
Upvotes: 0
Reputation: 351596
Go here:
Tools > Options > Text Editor > C# > Formatting > Indentation > Indent case labels
Upvotes: 60