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
close icon

Controlling TabStyle for TabbedMDI

I like the behavior in the TabbedMDI sample and tab look & feel in the XPTabs demo. Can I have both? More technically, I see that I can set the TabStyle property of a TabControlAdv, for example: tabControlAdv1.TabStyle = typeof(Syncfusion.Windows.Forms.Tools.OneNoteStyleRenderer); On the other hand, integrating the TabbedMDI framework involves creating a TabbedMDIManager. So, is there a way to associate an TabControlAdv with a TabbedMDIManager or some other means to associate a tab renderer with a TabbedMDIManager? Thanks, Jay Cincotta

3 Replies

JC Jay Cincotta March 4, 2004 04:26 PM UTC

Well, I figured something out, though I''d be happy to hear of any smarter solutions. Basically, once the parent has forms, you can get the TabHost from any of them, the get the MDITabPanel from that. The code to do this below, but I''m not happy with it because it only sets tab style for the current MDITabPanel. Therefore, any new tab groups created will not automatically have the desired TabStyle. What I''m really looking for is a way to be able to set the TabStyle as new tab groups are created. Is there an event I can wire to? private void MainForm_Load(object sender, System.EventArgs e) { tabbedMDIManager.AttachToMdiContainer(this); Form[] forms = tabbedMDIManager.MdiChildren; if (forms.Length > 0) { Form doc = forms[0]; TabHost tabHost = tabbedMDIManager.GetTabHostFromForm(doc); MDITabPanel tabPanel = tabHost.MDITabPanel; tabPanel.TabStyle = typeof(OneNoteStyleRenderer); } }


JC Jay Cincotta March 4, 2004 04:41 PM UTC

Okay, finally figured it out. I just need to subclass TabbedMDIManager. Very nice. Here''s the code: public class OneLookTabbedMDIManager : TabbedMDIManager { protected override MDITabPanel CreateMDITabPanel() { MDITabPanel tabPanel = base.CreateMDITabPanel (); tabPanel.TabStyle = typeof(OneNoteStyleRenderer); return tabPanel; } }


AD Administrator Syncfusion Team March 4, 2004 06:22 PM UTC

Hi Jay, Thanks for sharing this information with us. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion,Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon