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
1483
Detect when all panes are floating or hidden
posted

Hi

I'd like to detect when the control that is hosting a dock manager is empty so I can put a label and context menu on the now empty control.   The user would use the context menu on the label to return the cotnrols back to the dock.  By empty I mean all controls have been either floated, hidden or unpinned. I'd also like to remove the label when the dock is no longer empty.  What is the best event to hook to to determine this?

 

Thanks,

Bill

  • 44743
    Suggested Answer
    posted

    I think you wuold have to handle multiple events for this. I would recommend making a single helper method which loops through the ControlPanes of the dock manager and checks whether each on is docked to the Form and pinned. If no panes are, then you could add your label and context menu. I would call this method from the following events: PaneDisplayed, PaneHidden, AfterDockChange, AfterPaneButtonClick, and AfterToggleDockState.