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
130
Contextual Tab Groups for an active pane when using WinDockManager
posted

I've created contextual tab groups in the WinToolbarsManager.  I'm also creating panes using the WinDockManager.  I'd like to have those contextual tabs appear only when a particular pane is active.  I thought I had come up with a way to make that happen.  I was using the AfterHideFlyout, BeforeShowFlyout, PaneActivate, and PaneDeactivate events on the WinDockManager to control the showing and hiding of the contextual tab groups.  However, when a user clicks on a combobox tool that is on the contextual tab, the pane becomes deactivated and the contextual group is hidden.  Clicking on checkboxes or buttons is fine.  So far, it only appears to be the combobox that deactivates the pane.

Any suggestions?

Thanks in advance.

Parents
No Data
Reply
  • 44743
    posted

    Editor tools, such as TextBoxTool and ComboBoxTool instances must take focus when they become active, so they can respond to key messages. There is no way around this. What you can do in your application is check the active tool when a pane deactivates. If it is within a contextual tab group that is associated with the pane that was deactviated, delay the hiding of the group. You can determine which contextual tab group the active tool is in with the following (untested) code:

    ToolBase activeTool = this.ultraToolbarsManager1.ActiveTool;
    if(activeTool != null)
    {
     RibbonGroup ribbonGroup = activeTool.OwningRibbonGroup;
     if(ribbonGroup != null)
     {
      ContextualTabGroup tabGroup = ribbonGroup.Tab.ContextualTabGroup;
      if(tabGroup != null)
      {
       //...
      }
     }
    }

Children
No Data