AD
Administrator
Syncfusion Team
July 9, 2004 05:09 PM UTC
Hi TJ
Can you post some more information on your requirements. Specifically, when do you want to want to enable the items in your Menu(s): For example is it when you click on the ParentBarItem?
Regards
Arun
TJ
TJ
July 9, 2004 07:05 PM UTC
Hi, Arun.
Here''s a typical scenario: I''ve got a lot of menu items that should be enabled
only if I have a file open. Right now I''m doing it like this:
this.MenuClose.UpdateUI += new EventHandler (MenuEnableIfFileOpen);
this.MenuPrint.UpdateUI += new EventHandler (MenuEnableIfFileOpen);
...
private void MenuEnableIfFileOpen (object sender, EventArgs e)
{
BarItem menu = sender as BarItem;
if (menu != null)
menu.Enabled = this.IsFileOpen;
}
But I''ve been looking for another event to use instead of UpdateUI.
The documentation for UpdateUI suggests using another technique in most cases,
but is vague on what that technique might be. I''m thinking of something like
"OnAboutToShowMenu", but I don''t think that exists...
Ah, but that won''t work if the menus (um, BarItems) are shown on a toolbar, will
it? Okay, now I understand why there isn''t such an event...
I think I''ll stay with the UpdateUI technique, then. No problem.
Thanks,
Tom