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.
Unfortunately, activation email could not send to your email. Please try again.

Docking Panel Close/Hide Button Event?

Thread ID:





84415 Jun 30,2009 01:12 PM Jul 6,2009 07:54 AM Windows Forms 6
Tags: Tools
Asked On June 30, 2009 01:12 PM

Hi, how can i raise an event when i click the close button (X) of a docking panel?

Thanks, David.

Replied On June 30, 2009 01:40 PM

OK, i have found the click event of this.dockingManager1.CaptionButtons["CloseButton"] and i can successfully raise this event when i close a panel.

Only problem now is, how can i tell which panel i closed or how can i get the name of the docked control that was closed?

Replied On July 1, 2009 06:24 PM

Ok, scrap what i asked for, what i actually need is a way of raising an event when a docked control is set to "Hide", not just using the close button, but also by selecting hide from the context menu.


Fathima Shalini P [Syncfusion]
Replied On July 2, 2009 08:50 AM

Hi David,

Thank you for your interest in Syncfusion Products.

When closing the DockedPanel using close button or using ContextMenu, DockVisibilityChanging and DockVisibilityChanged event. Using the event's Control property we can easily trace out the control being closed. Kindly refer to the provided documentation links that depicts this:



Please let me know if any concerns.


Replied On July 2, 2009 07:55 PM

I can't get it to work, it seems that the DockVisibilityChanged event never gets fired. I tried calling a simple MessageBox, but it still doesn't work when i click the "close" button or press "hide" from the contextmenu.

I have no idea why this event doesn't work.

I've also tried using other events like AutoHideAnimationStart, and i still can't get it to fire. It seems that the dockingmanager isn't responding to events?

Is this a bug or something?

Replied On July 2, 2009 08:10 PM

Seems that the events only get fired when I add the eventhandler within the BeginInit() and EndInit() statements. It doesn't seem to work when i just add them using the Events panel in the properties window.

Anyway thanks for your help.

Fathima Shalini P [Syncfusion]
Replied On July 6, 2009 07:54 AM

Hi David,

Thank you for your update.

I tested the issue with the simple sample in which I have docked two panels and added event handlers using properties window at design time. I could see DockVisibilityChanged and DockVisibilityChanging events triggered when closing the docking control both by clicking the close button and using Hide option.


Please let me know if any concerns.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.