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.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

121216 Nov 19,2015 09:48 AM UTC Dec 8,2015 01:27 PM UTC Windows Forms 5
loading
Tags: TabbedMDIManager
SysNop
Asked On November 19, 2015 09:48 AM UTC


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

Senthil Kumaran Rajan [Syncfusion]
Replied On 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


SysNop
Replied On 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

Senthil Kumaran Rajan [Syncfusion]
Replied On 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

SysNop
Replied On December 3, 2015 11:46 AM UTC

Thank You.

Regards

Saravanan T [Syncfusion]
Replied On 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

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

;