单击拆分按钮时在MenuController中添加按钮 [英] Adding Buttons in MenuController when split button is clicked
问题描述
这是要求。我有一个MenuController。我想知道如果单击拆分按钮时可以在拆分菜单中添加按钮。通常你可以在初始化过程中动态添加按钮,但我希望每次单击分割菜单按钮时都会更新我的Menucontoller菜单
。
Here is the requirement. I have a MenuController. I am wondering that if it is possible to add Buttons inside the split menu when the split button is clicked. Normally you can add buttons dynamically during the initializaton but I want my Menucontoller menu updated every time I click the split menu button.
提前致谢。
推荐答案
überalls,
Hi überalls,
根据您的描述,您似乎想要动态添加菜单项。如果是这样,你可以创建一个继承自
的动态菜单命令类
OleMenuCommand 。有关详细信息,请参阅:
Based on your description, it seems that you want to add Menu Items dynamically. if so, you could You create a dynamic menu command class that inherits from OleMenuCommand. For more information, please refer to:
https://docs.microsoft.com/en-us/visualstudio/extensibility/dynamically-adding-menu-items
祝你好运,
Cole Wu
这篇关于单击拆分按钮时在MenuController中添加按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!