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

MDI Tabs - A tabbed MDI child list

6 Replies

HP Holger Persch April 27, 2005 10:13 AM UTC

Ups, sorry for the formatting! Because of waiting a long time for something like I asked for here: http://www.syncfusion.com/Support/forums/message.aspx?MessageID=7891, I now have written it by myself. I''''m posting this here because I want to share it with other Essential Tools users. It works almost perfectly for our needs except of the tabcontrol''''s background color. I want the tabcontrol to draw it''''s background in the "Office 2003" design like the XP menus and toolbars do (Please have a look to the screenshot include in the zip-file). Maybe Syncfusion takes this as an idea to add a new component with the same or similarly funktionality into the Essential Tools library. Regards Holger Persch


AD Administrator Syncfusion Team April 27, 2005 03:16 PM UTC

Hi Holger, I like your sample. I''ll make sure to point people to this post if they have a similar question. Regarding the background color, you can generate your own gradient for the TabControlAdv by overriding the OnPaint method and using the Office2003Colors class in the Syncfusion.Windows.Forms namespace. The following code snippet (while a couple pixels off) demonstrates the method for doing this: public class GradientTabControlAdv : Syncfusion.Windows.Forms.Tools.TabControlAdv { public GradientTabControlAdv() : base() { } protected override void OnPaint(PaintEventArgs e) { System.Drawing.Brush b = new System.Drawing.Drawing2D.LinearGradientBrush(e.ClipRectangle, Syncfusion.Windows.Forms.Office2003Colors.MenuMarginColorLight, Syncfusion.Windows.Forms.Office2003Colors.MenuMarginColorDark, 90, true); e.Graphics.FillRectangle(b, e.ClipRectangle); base.OnPaint(e); } } Hope it helps. Regards, Gregory Austin Syncfusion Inc.


HP Holger Persch April 29, 2005 07:18 AM UTC

Hi Gregory, Thanks a lot, now it looks perfectly. I modified the sample, now it also contains a toolbar. I want the MdiTabs bar to dock below the toolbar and in Design-Mode this works fine, but during Runtime it docks between the menubar and the toolbar. I''m fixing this by setting RowIndex to 2. But how about the case if there are more than one toolbar, how can I then calculate the correct RowIndex or respectively dock the MdiTabs bar below all these toolbars? Regards Holger MdiTabsTest_4606.zip


HP Holger Persch April 29, 2005 11:30 AM UTC

Hi Gregory, There is another problem: If a MDI child form, that uses additional toolbars, is opened then the toolbars are rearranged and the MdiTabs bar moves into the second row (Please have a look to the attached screenshots). How to handle this? Is there an event that is fired when a toolbar is shown or hidden? Thanks in advance, Holger Screenshot_4633.zip


AD Administrator Syncfusion Team April 29, 2005 05:37 PM UTC

Hi Holger, The reason that the Toolbars load differently than the designer is that you have AutoLoadToolBarPositions set to true. This overrides the designer setting. To make sure that the one bar is at the bottom, you can set the RowIndex to something ridiculously high, like 3007. RowIndex acts more like a sort order than an exact position. To control where the Child Form''s bar shows up you can expose that Form''s Bar, and then access the relevant control with the GetBarControl method. So, for example, you could add a ChildFrameBarManager and a Bar to Form2 and then add this property: public Syncfusion.Windows.Forms.Tools.XPMenus.Bar childBar { get { return this.bar1; } } Then in your MdiChildActivate handler in Form1, you could add this code: if (activeMdiChild is Form2) { this.barManager.GetBarControl(((Form2)(activeMdiChild)).childBar).RowIndex = 1; } Hope this helps. Regards, Gregory Austin Syncfusion Inc.


HP Holger Persch May 2, 2005 06:11 AM UTC

Hi Gregory, Now everything works fine :-) Thanks, Holger

Loader.
Live Chat Icon For mobile
Up arrow icon