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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to cancel ONE of multiple Tabbed Floating Control Closes

Thread ID:





69219 Oct 18,2007 08:37 PM UTC Oct 26,2007 10:54 AM UTC WinForms 1
Tags: Tools
Asked On October 18, 2007 08:37 PM UTC

Using DockingManager:
I have 2 controls floating, tabbed.

When the user clicks the Close button, I don't want BOTH to close, just the current one.

I know I need to use the DockVisibilityChanging, but don't really know how to accomplish this. If I cancel, it cancels all of them.

I need the first non-selected control in the tab group to become the active control, and the one that was active to go away.

Golda Rebecal [Syncfusion]
Replied On October 26, 2007 10:54 AM UTC

Hi ERobishaw,

Sorry for the delay in responding.

You can achieve your requirement using the following code:

void dockingManager1_DockVisibilityChanging(object sender, DockVisibilityChangingEventArgs arg)
bool flag = false;
DockHost dhost2 = arg.Control.Parent as DockHost;
DockHostController dhc = dhost2.InternalController as DockHostController;
if ((dhc.ParentController != null) && (dhc.ParentController is DockTabController))
DockTabController dtc = dhc.ParentController as DockTabController;
DockTabControl tabcontrol = dtc.TabControl as DockTabControl;
TabPageAdv tab1 = tabcontrol.SelectedTab;
foreach (TabPageAdv tab in tabcontrol.TabPages)
if (tab.TabVisible == true)
flag = true;
if (flag)
arg.Cancel = true;

Please refer to the attached sample that illustrates the same:

Kindly let me know if this helps you.

We appreciate your interest in Syncfusion products.

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon