A
aualias
I have a UIManager object that sets properties on various UI objects when
certain events happen in the application (my events, not standard events).
Objects can register and unregister for these events.
If I wish to enable a menu item (but do not want expose it as a property)
from the UIManager, can I somehow use the Name property to find the
MenuItem? Or is this strictly a design time property?
Right now I have a method in the form called EnableMenuItem(string
menuItemText, bool bEnable) which recursively searches through the main menu
until it finds the MenuItem whose Text property matches. Then it sets the
Enabled property of the MenuItem. This seems cumbersome.
Is there a more direct way to find a MenuItem?
I suppose that I could expose any needed MenuItems as properties and
retrieve them directly. I prefer a less specific solution.
Alfredo
certain events happen in the application (my events, not standard events).
Objects can register and unregister for these events.
If I wish to enable a menu item (but do not want expose it as a property)
from the UIManager, can I somehow use the Name property to find the
MenuItem? Or is this strictly a design time property?
Right now I have a method in the form called EnableMenuItem(string
menuItemText, bool bEnable) which recursively searches through the main menu
until it finds the MenuItem whose Text property matches. Then it sets the
Enabled property of the MenuItem. This seems cumbersome.
Is there a more direct way to find a MenuItem?
I suppose that I could expose any needed MenuItems as properties and
retrieve them directly. I prefer a less specific solution.
Alfredo