Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Subclassing Collapse All
Subject Author Date
Przemyslaw Luniewski May 14, 2009 - 4:03 AM

Hi,


is it possible to subclass ElegantRibbon controls?


MSDN (cit.): All the parts [of a class] must use the partial keyword.


Do you declare ER classes as partial?


If so, I would like to globally override PopupMenu.OnShowing - can you explain how to do it, please?


 

Przemyslaw Luniewski May 14, 2009 - 4:34 AM

Okay, this is my mistake, I should derieve from PopupMenu and then override


Anyway, is there any way to add some custom global behaviour to buttons’ PopupMenus?


I’d like to disable some PopupMenu’ items depending on some specific conditions, like user name.

Technical Support May 14, 2009 - 12:42 PM

You can enable/disable any of the controls in the popup menu using the Enabled property of the base class. For instance:

Elegant.Ui.PopupMenu popupMenu1 = new Elegant.Ui.PopupMenu();
Elegant.Ui.Button button1 = new Elegant.Ui.Button();
button1.Text = "Some text";
popupMenu1.Items.Add(button1);
Then you can switch the enabled/disabled button state somewhere in your code in the following way:
button1.Enabled = false;

Przemyslaw Luniewski May 15, 2009 - 12:23 AM

Ok thanks.