Disclaimer: this is about using Visual Studio and its GUI. It is not about a VS extension.
Context:
I like to have toolbar buttons to sort and remove using
directives in .cs
files. In VS 2015 there were two dedicated commands (and hence buttons) to do this, each with their own icon. Now in VS 2017 there's a single command to do that (Remove and Sort Usings) but it has no icon, just text. See pciture below, command is there, but text only:
I remember ages ago, with VS 2010 I believe, you could somehow hack VS existing commands so to show custom icons. I think it was a matter of adding picture files in a special location, and either name them in a special way or reference them from some configuration file. I totally forgot how, but it was doable.
Question:
Does anyone know if this is still possible with VS 2017 and how? After some search I was not able to find an answer.
BTW question is similar to this unanswered one, but in my case it's about a regular VS command, not an external tool command.
TA
Edit: as suggested in comments, this CommandingImage extension used to work on VS 2010. It has not been updated, nor open-sourced, nor ported. Maybe someone as found its successor.
Add, remove, or move a toolbarOn the menu bar, choose Tools > Customize. The Customize dialog box opens. On the Toolbar tab, perform one of the following sets of steps: To add a toolbar, choose the New button, specify a name for the toolbar that you want to add, and then choose the OK button.
Go to VSCode settings ( CTRL+, or CMD+, ) and search for shortcut menu bar . Toggle buttons from there.
With Visual Studio 2017, it can be done using Visual Studio SDK where you can either write a extension or extend a existing menu command with a icon declared in the .vsct file. A simple example for the your need can be found here.
If you want to go for a simpler way, I would suggest to either use PowerCommands or Resharper to do the same. See here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With