Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Button status is not changing when it is used in a tool bar.

$
0
0

Hello,

I have a number of buttons implemented in my VS2017 extension. Buttons are described in VSCT file and get registered like this:

...

foreach(var c in commands) { var menuCommandID = new CommandID(c.commandSet, (int)c.id); var menuItem = new OleMenuCommand(c.handler, null, c.update, menuCommandID); commandService.AddCommand(menuItem); }

...

As you can see, the command update handler is registered in the OleMenuCommand constructor. The update handler works as expected. When I open the menu, the menu button status corresponds to the extension state. However, the same button in a tool bar is not shown properly. For example, 'Run' button in the extension menu is shown as enabled, while the same button in a tool bar is shown as 'disabled'. I have two questions: 1. Why the toolbar button state is not the same as menu button state? 2. Is there a way to force status update for buttons in a tool bar?

Thank you.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>