How to get the control contained into a TabPageAdv

Hi there,
I need to access the control contained into a TabPageAdv when TabControl_SelectedIndexChanged event occurs.

This is my code:

void TabControl_SelectedIndexChanged(object sender, EventArgs e)
{
Syncfusion.Windows.Forms.Tools.MDITabPanel __MDITabPanel = ((Syncfusion.Windows.Forms.Tools.MDITabPanel )sender);
TabPageAdv __TabPageAdv = ( ( TabPageAdv ) __MDITabPanel.TabPages[__MDITabPanel.SelectedIndex] );

System.Diagnostics.Debug.WriteLine("TabControl_SelectedIndexChanged");
}

__TabPageAdv contains the MDIControl that I need but I don't know where it is.

Can you help me?

Thanks and regards!

1 Reply

MU Murugan Syncfusion Team January 25, 2007 05:54 PM UTC

Hi Paul,

MDIControls can be accessed using _MDIPanel.GetSelectedForm() method which returns the Form object for the SelectedTab.

Here is the code snippet :

private void TabControl_SelectedIndexChanged(object sender, EventArgs e)
{

Syncfusion.Windows.Forms.Tools.MDITabPanel _MDIPanel = ( Syncfusion.Windows.Forms.Tools.MDITabPanel )sender;

Form FormAtselectedTab = _MDIPanel.GetSelectedForm();

foreach ( Control ctrl in FormAtselectedTab.Controls )
{

Console.WriteLine( ctrl.Name );

}

}

Herewith I have also attached the sample. Please have a look at the sample and let me know if it helps you.

TTA_TabControl

Thanks for choosing Syncfusion products.

Regards,
Murugan P.S

Loader.
Up arrow icon