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.

How to cancel ONE of multiple Tabbed Floating Control Closes

Thread ID:

Created:

Updated:

Platform:

Replies:

69219 Oct 18,2007 04:37 PM Oct 26,2007 06:54 AM Windows Forms 1
loading
Tags: Tools
ERobishaw
Asked On October 18, 2007 04:37 PM

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 06:54 AM

Hi ERobishaw,

Sorry for the delay in responding.

You can achieve your requirement using the following code:

[C#]
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;
tab1.Hide();
foreach (TabPageAdv tab in tabcontrol.TabPages)
{
if (tab.TabVisible == true)
{
flag = true;
break;
}
}
}
if (flag)
arg.Cancel = true;
}

Please refer to the attached sample that illustrates the same:
http://websamples.syncfusion.com/samples/Tools.Windows/F69219/main.htm

Kindly let me know if this helps you.

We appreciate your interest in Syncfusion products.

Best regards,
Golda

CONFIRMATION

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.

;