We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Event when closing gradientPanel

What is the best way to get notified when the user closes a gradient panel that is docked? Thanks Pascal

3 Replies

AD Administrator Syncfusion Team May 11, 2004 08:55 PM UTC

Hi Pascal, You could handle the DockingManager''s DockVisibility changed event (as shown below) for this purpose : private void dockingManager1_DockVisibilityChanged(object sender, Syncfusion.Windows.Forms.Tools.DockVisibilityChangedEventArgs arg) { if (arg.Control == this.gradientPanel1) { if (this.dockingManager1.GetDockVisibility(this.gradientPanel1)== false) MessageBox.Show("GradientPanel Closed"); } } Note that the docking window is actually hidden when the "X" button is clicked and not terminated. Let me know if this works for you. Thanks for considering Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


PT Pascal Tellier May 13, 2004 08:31 AM UTC

Thank you for the information. Here is what I am trying to achieve. I have a class that extends GradientPanel. I want this class to raise a closed event when the user clicks on the X. Is it possible to get a reference to the docking manager from the gradient panel? Thanks Pascal >Hi Pascal, > >You could handle the DockingManager''s DockVisibility changed event (as shown below) for this purpose : > >private void dockingManager1_DockVisibilityChanged(object sender, Syncfusion.Windows.Forms.Tools.DockVisibilityChangedEventArgs arg) > { > if (arg.Control == this.gradientPanel1) > { > if (this.dockingManager1.GetDockVisibility(this.gradientPanel1)== false) > MessageBox.Show("GradientPanel Closed"); > } > } > >Note that the docking window is actually hidden when the "X" button is clicked and not terminated. Let me know if this works for you. Thanks for considering Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.


AD Administrator Syncfusion Team May 13, 2004 10:34 AM UTC

Hi Pascal, I am afraid, it is not possible to reference the DockingManager from within the derived GradientPanel (or any dockable control), and this approach is not recommended as well. The best way to gao about this would be to handle the DockingManager''s DockVisibilityChanged method, check for the control that has been closed, and then do the necessary task. Please let me know if you need additional information. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Up arrow icon