Hi.
I'm developing a MDI application using a UltraTabbedMdi and UltraToolbars, allowing parent form to merge ribbons.
Everytime I show a new form I call this function to show the child form ribbon:
private void ActivatesRibbonTab(string tabName)
{ UltraToolbarsManager activeChildManager = this.toolsManager.ActiveMdiChildManager; if (activeChildManager != null) { if (activeChildManager.Ribbon.Tabs.Contains(tabName)) { toolsManager.Ribbon.SelectedTab = activeChildManager.Ribbon.Tabs[tabName].AttachedParentTab; } } }
Ok, this works fine, but, I'd like to select it everytime the child form becomes active. I've tried to activate it in the Enter & Activate child events and in the TabSelected event of UltraTabbedMdi control. But I can't get it, due sometimes the ribbon has not been active yet.
Whic event should I use to get the ribbon selected everytime the user select one mdi tab?
Thanks.
Hello,
Please handle the main form's MDIChildActivate event and handle your function there.
Let me know if you have any questions regarding this matter.
Hi Michael, thanks for you help.
No, when MDIChildActivate is fired, child ribbon has not been assigned yet.
Hi Michael.
It's ok, it works fine. Thanks.
Just a little question, do you know how can I change the ribbon's font at runtime?
Regards.
You can override the Ribbon tab font my accessing the Settings.Appearance object and updating the FontData.Name property.
eg. ultraToolbarManager.Ribbon.Tabs[0].Settings.Appearance.FontData.Name = "Arial Black"
Must I change part by part, I mean, Tabs, Caption, Groups, etc. or can I change all objects font in one sentence?
Something like:
Ribbon.Appearance.FontData = "Arial";
You'll want to use the general Appearance object on the ToolbarsManager. The ribbon itself doesn't have one. Keep in mind that any setting set on a child object will override the one set at the toolbar level. In case you need to override them separately I have listed the objects below.
Hierarchy:
UltraToolbar.Apperance
Ribbon
Tabs Collection > Tab > Appearance (unique)
Tabs.TabSettings > Appearance (all)
Group
Groups Collection > Group > Settings.Appearance (unique)
Tab > GroupSettings.Appearance (all groups in a tab)
Let me know if you have any questions.
Ok, thanks again.
Regards