Auto-Format Code in Visual Studio

Visual Studio will automatically format your selected code by pressing CTRL+K+F (note: hold down the control key continuously, press K then press F).


To format all code in your currently active file in Visual Studio, press CTRL+K+D (same note as above).


For a list of more pre-defined keyboard shortcuts in Visual Studio 2010 visit this MSDN link:


And for a great macro to show all active shortcuts, check out this MSDN link:


I continue to be impressed by the depth of tools within Visual Studio.

Leave a Reply

Your email address will not be published. Required fields are marked *