I've created a toolbar button in a Visual Studio extension. This toolbar contains a button with text and icon.
The button has two states. When first clicked, the button displays icon1. After a second click, the button displays icon2. The button will switch between these two icons.
I also wants to display different tooltip help for icon1 and icon2.
Is it possible to switch button icon with Visual Studio extension toolbar?
I've created a toolbar button in a Visual Studio extension. This toolbar contains a button with text and icon.
The button has two states. When first clicked, the button displays icon1. After a second click, the button displays icon2. The button will switch between these two icons.
I also wants to display different tooltip help for icon1 and icon2.
Is it possible to switch button icon with Visual Studio extension toolbar?
Share Improve this question edited Mar 26 at 1:34 Dou Xu-MSFT 3,5461 gold badge5 silver badges8 bronze badges asked Mar 25 at 8:26 nonadoesnonadoes 255 bronze badges1 Answer
Reset to default 1Is it possible to switch button icon with Visual Studio extension toolbar?
I am afraid not. I think there is no built-in feature/class to switch button icon upon click event.
From looking at this document OleMenuCommand Class
If the command is added dynamically, it makes more sense to use OleMenuCommand, in order to implement the BeforeQueryStatus handler.
Looks like we can update the status of the menu command in this method OnBeforeQueryStatus
by changing the Visible, Checked, and Enabled properties on the OleMenuCommand
object.
You can change the text of a menu command by following this guide1
You can change the appearance of a command by following this guide2
However i would suggest you can also report this issue at Visual Studio Forum to double confirm if there is any available feature to achieve it. That will allow you to directly interact with the appropriate product group, and make it more convenient for the product group to collect and categorize your issue.