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:
==========================================================================
If Not activeChildManager Is Nothing Then
Dim parentTab As RibbonTab = childTab.AttachedParentTab
If Not parentTab Is Nothing Then
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
This is not the recommended location to sync up after an mdi child has been merged. The problem is, hooking this event is the only way the toolbars manager can determine when to merge with the newly active child, and if the toolbars manager happens to hook the event after your code does, your event handler of MdiChildActivate will likely get called before the toolbars manager's event handler. You would be called before the merge, and it looks like that's what's happening here.
It is instead recommended that you override OnMdiChildActivate in the parent form. Your implementation should call the base implementation first (this will call all event handlers, including the one on the toolbars manager which performs the merge), then it should select the first child tab.
Thanks Mike, but I could use more data. Where should I try this?
Any examples I could look at?
Thanks again,