简体   繁体   English

启用/禁用菜单项

[英]Enabling/Disabling menu items

For any windows application there is a requirement to enable or disable menu items and buttons based on certain properties of a selected object. 对于任何Windows应用程序,都需要根据所选对象的某些属性启用或禁用菜单项和按钮。 What are the design patterns you have employed to do that? 您采用的设计模式是什么? I am currently developing an application that contains a number of projects and will require hundreds of menu items to change based on specific properties of each project. 我目前正在开发一个包含许多项目的应用程序,并且需要根据每个项目的特定属性来更改数百个菜单项。 I am thinking to have a method that essentially goes through each menu item and checks the project properties. 我想有一个方法,基本上遍历每个菜单项并检查项目属性。 Any other ideas to suggest? 还有其他想法吗?

Just to clarify, I am talking about ac# winforms application. 只是为了澄清,我说的是ac#winforms应用程序。

这里有一篇很好的文章: http//msdn.microsoft.com/en-us/magazine/cc188928.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM