1

Excuse me, I use Ms Visual Studio 2010. I try to follow many suggestion at this case, but I am still failed to make this functionality working well.. This is my code, still not formated well: not-working

This is my setting for C#: setting indent

setting 2

should I move to another IDE? I am familiar with intellij idea and netbeans IDE. But that IDE not supported C# Development... Any sugestion?

Thank You

5
  • use Ctrl+K+D for formatting code. its defaultly not formates code you need to do by your own. Commented Oct 10, 2014 at 11:28
  • I can nor read your code snippets since my company blocks images. Can you use the code snippet mechanism that is built into stackoverflow? Commented Oct 10, 2014 at 11:28
  • Blocks images?! That's crazy :S! Commented Oct 10, 2014 at 11:32
  • Sorry, I am use code blocks, stackoverflow maybe re-format the code automatically.. and I have press ctrl K and ctrl D.. It is not working at my IDE Commented Oct 10, 2014 at 11:36
  • No, Stack Overflow doesn't reformat automatically. Commented Oct 10, 2014 at 11:45

1 Answer 1

3

I suspect the problem is in your formatting options.

Under Options / Text Editor / C# / Formatting / Indentation, make sure that the "Indent open and close braces" box is not checked. Your code looks like it's formatted perfectly for a configuration where that box is checked. This is what my set of options looks like for that dialog:

Indentation options

Sign up to request clarification or add additional context in comments.

2 Comments

indent open and close braces has been checked, Sir.
@irhabymailed4u: Well that's why you've got that output. If you don't like the way it looks, uncheck it and reformat your code (Ctrl+E, D).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.