Hiiiii,
i m have used one parent form and multiple child forms. my child forms are opening in parent form. now i m used ultratoolbarmanager for ribbon tab on parent and child forms.. and then i m merged child form's ribbon tab with parent form.
Now problem is how can i set selected one particular tab in child form... ?
I m also tried with below code but it's not worked.
UltraToolbarsManager1.Ribbon.SelectedTab = UltraToolbarsManager1.Ribbon.Tabs("document")
is it any solution about set selected ribbon tab while merged parent and child form's ribbon tab.. ?
-- Hiren Lad
You would need to set the SelectedTab on the parent manager, not the child. So the way you would do that is by starting with the child tab you want selected and selecting the parent tab it is attached to:
Dim tab As RibbonTab = UltraToolbarsManager1.Ribbon.Tabs("document")Dim attachedParentTab As RibbonTab = tab.AttachedParentTabattachedParentTab.Ribbon.SelectedTab = attachedParentTab
Hiii Mike Dour.. Thanks for reply me...
One thing i m not specify in my question.. i m attached both parent and child forms's Ribbon tabs using MdiMergeable Property. it's by default set True.
Now i m confused where i put your code in my application.
i m put your code in my child forms but it generated below error
"Object or reference not set"...
Hey i m sending you my application snapshot..
Parent Form's Ribbon Tab...
Child Form's Ribbon Tab.. (Set MdiMergeable Property true)
How can i set Selected Document tab in this situation.. ?
Yes, it is possible AttachedParentTab could be null. I apologize for not mentioning that. You should probably check it for null before using the last line of my code snippet.
It is hard to say what is happening without knowing what is happening in your application. Are you setting MdiMergeable to False on both the parent and child managers? Your description is a little unclear. If so, that means you are probably merging the toolbars managers manually by setting the ActiveMdiChildManager of the parent or the MdiParentManager of the child. If so, you would need to run the code after performing the manual merge. However, if this is not true, and MdiMergeable is True, then automatic merging will take place. You should run my code after that occurs. You can do this by overriding the OnMdiChildActivate method on the parent Form. Call the base implementation first, which will perform the merge, then run the code I provided.
Hello.. Mike..
Your code is working.. i put this code on forms shown event.. Now it's successfully working..
Thanks for your Support..