tags:

views:

16

answers:

1

Hello, I'm creating a .Net3.5 Application (c#) and I want to write a generic code that synchronizes certain properties between toolbar buttons and menu Items that have the same purpose. For example setting a button as disabled should set the respective menu item as disabled. My idea is to hold in a dictionary the lists of "paired" controls. Any ideas?

A: 

There is a CodeProject article here that explains how to use the manager for the Edit Controls and how the menu gets synchronized. I know the code has not being updated in a while as it uses the .NET 2003 framework, but I am sure it can be recompiled cleanly to coer the .NET 2 Framework.

The real beauty of this code is that if you have edit controls, the 'Edit' menu automatically synchronizes based on the edit control, i.e. if it can be 'Cut', 'Copy' or 'Paste' and it will deactivate/activate the menu item for that 'Edit' menu.

Hope this helps, Best regards, Tom.

tommieb75