471,326 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 software developers and data experts.

C# ide VS. VB ide

cj
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. I kinda liked that
in VB. If I removed an if else block it would reindent the code etc.
Is that something I can turn on or is it just not done in C#?
Jun 27 '08 #1
7 1187
Hi,

No, this feature does not exist in C#. This is by design. To readjust
indentation you have to delete/add an end block } or end statement ; at a
higher level.

--
Happy Coding!
Morten Wennevik [C# MVP]
"cj" wrote:
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. I kinda liked that
in VB. If I removed an if else block it would reindent the code etc.
Is that something I can turn on or is it just not done in C#?
Jun 27 '08 #2
On Jun 24, 9:32*am, cj <c...@nospam.nospamwrote:
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. *I kinda liked that
in VB. *If I removed an if else block it would reindent the code etc.
Is that something I can turn on or is it just not done in C#?
I don't know of a setting that does this, but there's a keyboard chord
that will do pretty much the same thing. As long as your code can be
parsed, you can hit ctrl-k -ctrl-f to reformat whatever you have
selected. I often hit ctrl-a beforehand to do the whole file.

I prefer this to VB's autoformat. I've noticed sometimes that when vb
does its autoformatting trick, each of the indents/unindents are put
into the editor's undo history. Now, if want to ctrl-z over my last
few code changes, I have to back up over each of the formatting
changes that were put in. What I mentioned above might function the
same way (I've never noticed this problem in C#), but I at least have
more control over when I want it to happen.
Jun 27 '08 #3
Hi.
I'm not sure that I understand your problem but if you are using Visual
Studio, you can reformat the whole document by pressing (CTRL+E, D) or
(CTRL+K, D).

Kind regards,
Tommy

cj wrote:
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. I kinda liked
that in VB. If I removed an if else block it would reindent the code
etc. Is that something I can turn on or is it just not done in C#?
Jun 27 '08 #4
On Jun 24, 9:32*am, cj <c...@nospam.nospamwrote:
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. *I kinda liked that
in VB. *If I removed an if else block it would reindent the code etc.
Is that something I can turn on or is it just not done in C#?
you can reformat the document using Ctrol K + Control D
Jun 27 '08 #5
cj
Thanks everyone.

cj wrote:
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. I kinda liked that
in VB. If I removed an if else block it would reindent the code etc. Is
that something I can turn on or is it just not done in C#?
Jun 27 '08 #6
On 24 Jun, 19:51, cj <c...@nospam.nospamwrote:
Thanks everyone.

cj wrote:
I just stated writing some C# code and I notice it doesn't seem to go
back and correct indentation etc like it does in VB. *I kinda liked that
in VB. *If I removed an if else block it would reindent the code etc.Is
that something I can turn on or is it just not done in C#?
Also consider Resharper. It's an add in that pays for itself in about
four minutes. I don't think I want to use VS without it again :)
Jun 27 '08 #7
>you can reformat the document using Ctrol K + Control D

Sorry, what do you mean by
Control K + Control D?

Is that
Control + K
then
Control + D ?
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.