Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
665
Set a child ribbon tab on a parent MDI form
posted

I'm try to get each ribbon tab on child form when its loaded to set the first tab (index 0) so the user would see this tab as the selected tab.

I read the following blog and tried it in VB.net:

>>> Ultratoolbarsmanager: How to programmatically activating a child tab

Here's my code: 

==========================================================================

Dim activeChildManager As UltraToolbarsManager = Me.UltraToolbarsManager1.ActiveMdiChildManager

If Not activeChildManager Is Nothing Then

      Dim childTab As RibbonTab = activeChildManager.Ribbon.Tabs(0)

      Dim parentTab As RibbonTab = childTab.AttachedParentTab

If Not parentTab Is Nothing Then

              Me.UltraToolbarsManager1.Ribbon.SelectedTab = parentTab

Else

End If

========================================================

But, [activeChildManager] is "Nothing"  when I run the code

Note: the above code is located in the parent MDI form "MdiChildActivate" event.

Is the the correct location? (this is where I would like to manage all forms that load)

Have we missed something?

Thanks ahead of time.

Patrick

Parents Reply Children