We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

If not UpdateUI, then what event?

Thread ID:

Created:

Updated:

Platform:

Replies:

16207 Jul 8,2004 05:11 PM UTC Jul 9,2004 07:05 PM UTC WinForms 2
loading
Tags: Tools
TJ
Asked On July 8, 2004 05:11 PM UTC

Hi. I see in the documentation for the BarItem.UpdateUI event that this event should be used only if certain conditions are met. Otherwise... It doesn''t suggest what event I should use. I''d like to dynamically enable my XPMenu items in some sort of event handler, if possible. An "OnGetMenuState" event, or whatever, but I can''t find any such event. Is there one? (Version 2.0.5.1) Thanks, Tom

Administrator [Syncfusion]
Replied On 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
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;