I can't find the Reformat button, I know I can use ctrl+k+d, but I wish to have also the toolbar with the button. can someone help me ?
-
See http://stackoverflow.com/questions/5755942/how-do-you-auto-format-code-in-visual-studio – Jérôme Pouiller Sep 04 '15 at 10:25
3 Answers
You can use Edit > Advanced > Format Document and you can also move this as a button to any toolbar. Go to Tools > Customize > Commands, select Toolbar and push Add Command button. Then select Edit category and find Document Format.

- 31,522
- 9
- 59
- 103

- 360,892
- 59
- 660
- 670
-
thanks, I've searched the for the command in order to add it but didn't find it in the Edit category – Erez May 29 '11 at 13:12
-
1Sorry it is called Document Format not Format Document in commands. – Ladislav Mrnka May 29 '11 at 13:16
-
Mine does not show either "Format Document" nor "Document Format" under the edit menu list when adding a new command. Any other thoughts on where to find it? – Wolfie Nov 18 '15 at 16:33
Apparently VS2010 (maybe others) hide certain commands depending on the style you choose. I chose Web Dev (code) as my choice and the Document Format is not present to be added to a toolbar. But, if I change to C# Code (tools>Import/Export) then the Document Format command is right there in the Edit menu where others here have said it is.
I had to import the C# Dev layout, but unchecked colors and code formatting options (so it won't overwrite those). What section you must import to get the format document button, I don't know, I didn't experiment that deep.
Seems stupid MS chose to force us down specific paths for layout with no convenient way to get out of it.

- 1,801
- 1
- 14
- 16
If you can't find it in the Edit menu: you can also find it if you press CTRL + P and then type >format. The shortcut is SHIFT + ALT + F

- 951
- 1
- 7
- 13