How to add the second toolbar NEXT TO |
Post Reply |
Author | |
Onur
Groupie Joined: 17 August 2005 Status: Offline Points: 37 |
Post Options
Thanks(0)
Posted: 17 August 2005 at 10:37pm |
Hi, How do I "add" the second toolbar right NEXT TO the first one? CommandBar TB1 = CommandBars.Add("Toolbar 1", XTPBarPosition.xtpBarTop); |
|
Onur
Groupie Joined: 17 August 2005 Status: Offline Points: 37 |
Post Options
Thanks(0)
|
Found my solution from SuperMario's answer to another post..
Re-syntaxeed for C#.. private void DockToolbarOnRightOf(CommandBar BarToDock, CommandBar BarOnLeft){ int left, top, right, bottom;CommandBars.RecalcLayout(); BarOnLeft.GetWindowRect( out left, out top, out right, out bottom);CommandBars.DockToolBar(BarToDock, right, (bottom + top) / 2, BarOnLeft.Position); } |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Thought this might be useful...had it laying around from another help request. It allows toolbars to be docked text to each other when vertical as well:
You can use this helper function to dock a toolbar to the right of another: private void DockRightOf(XtremeCommandBars.CommandBar BarToDock, XtremeCommandBars.CommandBar BarOnLeft, Boolean VerticalBar) { int left, top, right, bottom; XtremeCommandBars.CommandBar LeftBar = BarOnLeft; CommandBars.RecalcLayout(); LeftBar.GetWindowRect(out left, out top, out right, out bottom); if (VerticalBar == false) CommandBars.DockToolBar(BarToDock, right, (bottom + top) / 2, LeftBar.Position); else CommandBars.DockToolBar(BarToDock, (left + right) / 2, Bottom, LeftBar.Position); } Parameters: BarToDock - ToolBar to be placed to the RIGHT of another ToolBar BarOnLeft - ToolBar that will be on the LEFT side of BarToDock VerticalBar - Set to false if the toolbars are docked at the top or bottom of the window (horizontal), set to true if the toolbars are on the left or right of the window (vertical). Sample usage: XtremeCommandBars.CommandBar ToolBar, ThemesBar; //..........Add controls to toolbars DockRightOf(ThemesBar, ToolBar, false); |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Here is both the C# and VB version:
Question:
Answer:
// C# Code VB6 Code ' VB6 Code |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |