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.
ADAdministrator Syncfusion Team April 27, 2005 10:16 AM
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);
Hope it helps.
HPHolger PerschApril 29, 2005 02:18 AM
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?
HPHolger PerschApril 29, 2005 06:30 AM
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,
ADAdministrator Syncfusion Team April 29, 2005 12:37 PM
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
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.
HPHolger PerschMay 2, 2005 01:11 AM
Now everything works fine :-)