tags:

views:

103

answers:

1

I remember back when I used to do C++ Builder apps, you could create an action, then associate a menu item or context menu item, etc to the action. That way if you dis something like disable the action , the associated menu items would all be disabled. Is there something like that in a .net 2 winforms app?

+3  A: 

What you are referring to is the command pattern. There really isn't something out of the box in .NET 2.0 for Windows Forms.

Doing a Google search for "command pattern windows forms" brings up a few blog entries which point out how you might implement it yourself, but I don't see anything in the form of a library or something to facilitate this.

If you are using .NET 3.0, you can switch to WPF, which has command pattern functionality built in.

casperOne