   format your selection
  Is there a way to create a button on a toolbar in Visual Studio so it will format your selection?  I have tried for awhile, but I can't figure this out.
  There's a Format Document and Format Selection command. You can add them to the toolbar of your choice.   ;  I figured it out.  The trick is that the command is called "Selection Format" when you add it (as opposed to "Format Selection").Also, I tried the "Document Format" command, but it is always grayed out.  Any ideas why?;Quote:Original post by ms75214I figured it out.  The trick is that the command is called "Selection Format" when you add it (as opposed to "Format Selection").Also, I tried the "Document Format" command, but it is always grayed out.  Any ideas why?It is a well known quirk in Visual Studio, which 3 seconds on Google could have answered.  For some stupid editor reasons files are treated differently based on their extensions: "documents" are treated differently than "code" and "document templates".  Ctrl-K, Ctlr-F works on code files (C++, C#, VB, ...), Ctrl-K, Ctrl-D works on document files (HTML, XML, XAML, ...)   ;Quote:Original post by frobQuote:Original post by ms75214I figured it out.  The trick is that the command is called "Selection Format" when you add it (as opposed to "Format Selection").Also, I tried the "Document Format" command, but it is always grayed out.  Any ideas why?It is a well known quirk in Visual Studio, which 3 seconds on Google could have answered.  For some stupid editor reasons files are treated differently based on their extensions: "documents" are treated differently than "code" and "document templates".  Ctrl-K, Ctlr-F works on code files (C++, C#, VB, ...), Ctrl-K, Ctrl-D works on document files (HTML, XML, XAML, ...)Ctrl-K, Ctlr-F does seem to work, but I'm looking for a button, and the "Document Format" button is always grayed.   