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
20
How can I detect what pane was clicked by the user definitely?
posted

Hi. I'm the user of  NetAdvantage for .NET 2009.1. Some instances of UserControl are inherited from UserControlBase with UltraDockManager.  The app has to select some fist level child pane and second level child pane (if the fist level child pane has children), etc, when a user clicks on root pane. UltraDockManager.PaneActivate is processed with UserControlBase. I would identify the selected pane in UltraDockManager.PaneActivate.There is no events like MouseClick in UltraDockManager and DockableControlPane. How can I detect what pane was clicked by the user definitely?

P.S. I noticed UltraDockManager.PaneActivate is raised twice for child panes when a user clicks on root pane. Generally, when there is an event UltraDockManager.PaneActivate the app doesn't identify is pane activated by the user or the app.

  • 5118
    Suggested Answer
    posted

    I see a case has been created for this but the event args passed into the PaneActivate event handler yield the DockableControlPane that was activated.  This exposes the Control contained by the pane as well as the Key and many other properties that you can use to identify which Pane was actually activated.

    If you set Keys for your Panes you can quickly tell which one it was with a comparison.  If not you can use some other utility functions like:

     DockableControlPane dcp = this.ultraDockManager1.PaneFromControl(this.label1);

    There is also PaneFromPosition and PaneFromKey and you can compare that pane to the one sent in the PaneActivate to see if it is the one you wanted to know about.

    You are correct that all the events are funneled through the UltraDockManager and are not directly on the Pane's themselves but using the above techniques you can tell what pane was activated.