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. Image for the cookie policy date

How to customize Tabcontrol properties after first tab has been added in TabbedMDIManager


I have tabbedMdiManager on from.
When I start application and click menu button to add new form/tab to MDITabbManager then tabbedMDIManager_TabControlAdded event fires. It only fires once when I add that first form/tab.
In that event I change appearance and colors and etc.. for tabs for the first time.

What if I change Theme on whole form and I want to again change display, appearance and etc (FixedSingleBorderColor, BorderStyle, ActiveTabColor, InactiveTabColor) of  all Tabs in TabbedMDIManager. 

How I can achieve that?

Regards

5 Replies

SK Senthil Kumaran Rajan Syncfusion Team November 20, 2015 03:49 PM UTC

Hi SysNop,

Thank you for your update.

The Forms added into the TabbedMDIManager will be grouped into different TabControls. hence while adding the first form into TabbedMDImanager the TabControl will be created and the form will be added into it. TabControl can contain many number of TapPages, hence the rest of the form will be added into the TabControl, not in TabbedMDI. hence this event triggers only once.  This event can be triggered by creating new TabControl in the TabbedMDIManager. The reported requirement can be achieved by using the TabControlAdv ControlAdded event. Please make use of the below code example.

Code Example[C#]:

 //To add new tabcontrol and raise TabControlAdded event

this.tabbedMDIManager1.CreateNewHorizontalGroup();



//This event will be triggered if new TabControl is added.
private void tabbedMDIManager1_TabControlAdded(object sender, Syncfusion.Windows.Forms.Tools.TabbedMDITabControlEventArgs args)
{
MessageBox.Show("TabControl Added");
args.TabControl.ControlAdded += TabControl_ControlAdded;
}
//This event will be triggered while adding each form into the TabControl
void TabControl_ControlAdded(object sender, ControlEventArgs e)
{
MessageBox.Show("Control added as TapPages in TabControl");
}

We have prepared a sample for your reference and it can be downloaded from here.
 
Sample : http://www.syncfusion.com/downloads/support/forum/121216/ze/TabbedMDIEvent-1368248139 


Regards,
Senthil



SY SysNop November 24, 2015 12:47 PM UTC

Thank You for example but this is what I wan to accomplish:
I have mdi form with TabbedMDI manager and ribboncontrolAdv which I use to change form theme (Touch, Office2013, Office2010, Office 2007)
For example, I run program and set theme to Touch and set certain TabbedMdiManger  properties like    args.TabControl.TabPanelBackColor,    args.TabControl.ActiveTabColor and args.TabControl.InactiveTabColor within  tabbedMDIManager_TabControlAdded event.
After that I call two forms to put into TabbedMDIManager and set Metro form and control properties (FormBackColor, FormStyle, FormCaptionColor, other controls on that form: Styles etc )  through TabControl_ControlAdded event.

So now, when I have everything set, I want to change Theme on my MDI form from Touch To Office2010Silver.
Question is this?

How to set new theme to all my MDItabbs, Forms and controls within forms to new Theme (manually set colors, styles and etc..)? 

How to get and set Tabcontrol properties like  args.TabControl.TabPanelBackColor,    args.TabControl.ActiveTabColor and args.TabControl.InactiveTabColor (manually set colors, styles and etc..)?
How to get and set Form properties for each form/tab to new Theme (manually set colors, styles and etc..)?
How to get and set controls properties on each form/tab to new Theme (manually set colors, styles and etc..)?

Thank You.

Regards


SK Senthil Kumaran Rajan Syncfusion Team November 25, 2015 04:52 PM UTC

Hi SysNop,

Thanks for contacting Syncfusion Support.

Query
Response
How to set new theme to all my MDItabbs, Forms and controls within forms to new Theme (manually set colors, styles and etc..)? 

How to get and set Tabcontrol properties like  args.TabControl.TabPanelBackColor,    args.TabControl.ActiveTabColor and args.TabControl.InactiveTabColor (manually set colors, styles and etc..)?
The reported requirement can be achieved by customizing MDITabPanel from the TabGroupHost. Please make use of the below code example.

Code Example[C#]:

//To set the ActiveTabColor of TabbedMDI            this.tabbedMDIManager1.TabGroupHosts[0].MDITabPanel.ActiveTabColor = Color.Red;

//To set the TabPanelBackColor of TabbedMDI            this.tabbedMDIManager1.TabGroupHosts[0].MDITabPanel.TabPanelBackColor = Color.Yellow;

//To set the InActiveTabColor of TabbedMDI

            this.tabbedMDIManager1.TabGroupHosts[0].MDITabPanel.InactiveTabColor = Color.Green;


How to get and set Form properties for each form/tab to new Theme (manually set colors, styles and etc..)?
The TabbedMDIManager’s MDIChildren property is used to get a list of MDIChildren present in MDIContainer form's. Please make use of below code example.

Code Example[C#]:

foreach (Form form in this.tabbedMDIManager1.MdiChildren)

            {

                MessageBox.Show(form.Text);

            }


How to get and set controls properties on each form/tab to new Theme (manually set colors, styles and etc..)?
The reported requirement can be achived by using the below code example.

Code Example[C#]:

//To set the properties of TextBoxExt in form2
            form2.textBoxExt1.Enabled = true;



We have prepared a sample for your reference and it can be downloaded from here.

Sample : http://www.syncfusion.com/downloads/support/forum/121216/ze/TabbedMDIEvent-2056573110

Regards,
Senthil


SY SysNop December 3, 2015 11:46 AM UTC

Thank You.

Regards


ST Saravanan T Syncfusion Team December 8, 2015 01:27 PM UTC

Hi SysNop,

Thank you for your update.

Please let us know if you need any further assistance.

Regards,
Saravanan T

Loader.
Live Chat Icon For mobile
Up arrow icon