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

Connection between tab and the matching window

Thread ID:

Created:

Updated:

Platform:

Replies:

68119 Sep 9,2007 09:19 PM UTC Oct 10,2007 06:38 AM UTC WinForms 7
loading
Tags: Tools
Yoni
Asked On September 9, 2007 09:19 PM UTC

Hi,
When I put in the docking manager two or more windows (controls), I can get from each window to another by clicking on a tab that represent every window. So I want to know how can I get reference to the suitable window for every tab by the code ? Or in another words, how can I reach to the docked window object by it's "tabPageAdv" ?

thanks,
Yoni

Ajish [Syncfusion]
Replied On September 14, 2007 12:03 AM UTC

Hi Yoni,

Thank you for your interest in Syncfusion products.

Inorder to get the active docked tab you can make use of DockControlActivated event and get the current control that is active. Here is the code to get the name of the active tab control name,

private void dockingManager1_DockControlActivated(object sender, Syncfusion.Windows.Forms.Tools.DockActivationChangedEventArgs arg)
{

MessageBox.Show(arg.Control.Name);
}

Here is the sample for your reference,

Sample: http://websamples.syncfusion.com/samples/Tools.Windows/F68119/main.htm

Kindly let me if you need any further assistance.

Regards,
Ajish.

Yoni
Replied On September 16, 2007 08:33 PM UTC

hi,
The solution you have wrote is not what I meant.
When I have the reference for a tab ("tabPageAdv") in the docking manager
(the tabs that in click on them I move between the docked controls)
I want to get from it reference to the docked control that the tab refers to.

The solution you have wrote helps me to get the ref to the docked control by event after I move to another tab, I don't want to get the ref by event but by the ref of the tab.

How can I do it ???

thanks,
Yoni

Yoni
Replied On September 16, 2007 08:35 PM UTC

hi,
The solution you have wrote is not what I meant.
When I have the reference for a tab ("tabPageAdv") in the docking manager
(the tabs that in click on them I move between the docked controls)
I want to get from it reference to the docked control that the tab refers to.

The solution you have wrote helps me to get the ref to the docked control by event after I move to another tab, I don't want to get the ref by event but by the ref of the tab.

How can I do it ???

thanks,
Yoni

Yoni
Replied On September 16, 2007 08:35 PM UTC

hi,
The solution you have wrote is not what I meant.
When I have the reference for a tab ("tabPageAdv") in the docking manager
(the tabs that in click on them I move between the docked controls)
I want to get from it reference to the docked control that the tab refers to.

The solution you have wrote helps me to get the ref to the docked control by event after I move to another tab, I don't want to get the ref by event but by the ref of the tab.

How can I do it ???

thanks,
Yoni

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On September 26, 2007 06:59 AM UTC

Hi Yoni,

Sorry for the inconvenience caused.

You can access the inner TabPages by using the following code,

[C#]

foreach (Control ctrl in this.dockingManager1.ControlsArray)
{

Syncfusion.Windows.Forms.Tools.DockHost dhost = ctrl.Parent as Syncfusion.Windows.Forms.Tools.DockHost;
if (dhost != null)
{
Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as
Syncfusion.Windows.Forms.Tools.DockHostController;

if (dhc.ParentController is Syncfusion.Windows.Forms.Tools.DockTabController)
{
Syncfusion.Windows.Forms.Tools.DockTabControl docktab = (dhc.ParentController as
Syncfusion.Windows.Forms.Tools.DockTabController).TabControl;

foreach (TabPageAdv page in docktab.TabPages)
{
MessageBox.Show(page.Name);
}
}
}
}
Please check out the sample from the following location,

http://websamples.syncfusion.com/samples/Tools.Windows/F68119_New/Main.htm

Let me know if you want any more details.

Thanks,
Fahad

Yoni
Replied On October 6, 2007 06:02 PM UTC

Hey,
The solution you have wrote is not again what I meant.
The answer you wrote let me get a ref to the tabs by the docking control,
I have to know how to get the dockControl by the tab. (exactly the opposite of your solution)
I mean that if I have a "TabPageAdv" I want to know which control is the docked control that refers to the "TabPageAdv".


Thanks a lot,
Yoni

Administrator [Syncfusion]
Replied On October 10, 2007 06:38 AM UTC

Hi Yoni,

You can get the dock control by tab by accessing through ChildControllers collection.

The following code snippet illustrates this.

[C#]

foreach (Control ctrl in this.dockingManager1.ControlsArray)
{
if (!alreadyProcessed)
{
Syncfusion.Windows.Forms.Tools.DockHost dhost = ctrl.Parent as Syncfusion.Windows.Forms.Tools.DockHost;
if (dhost != null)
{
Syncfusion.Windows.Forms.Tools.DockHostController dhc = dhost.InternalController as
Syncfusion.Windows.Forms.Tools.DockHostController;

if (dhc.ParentController.ChildControllers.Count>0)
{
alreadyProcessed = true;
foreach (DockHostController dock in dhc.ParentController.ChildControllers)
{
MessageBox.Show(dock.DockLabel.ToString());
}


}
}
}
else
break;
}


Please refer the sample that demonstrates the same and let me know if you have any other queries.

http://websamples.syncfusion.com/samples/Tools.Windows/F68119_Oct10/main.htm

Regards,
Jaya

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.

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

;