<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : How to add the sec&#111;nd toolbar NEXT TO</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : How to add the sec&#111;nd toolbar NEXT TO]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 07:16:33 +0000</pubDate>
  <lastBuildDate>Wed, 26 Oct 2005 11:56:23 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=2741</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[How to add the sec&#111;nd toolbar NEXT TO : Here is both the C# and VB version: 	Question: 	 	How...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=9253&amp;title=how-to-add-the-second-toolbar-next-to#9253</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 2741<br /><strong>Posted:</strong> 26 October 2005 at 11:56am<br /><br />Here is both the C# and VB version:<br><br><p>	<b>Question:</b>	<br>	How do I Place One or More ToolBars on the Same Row?</p><p>	<b>Answer:</b>	<br> By default, when a toolbar is added, thetoolbar appears on a separate row. Each toolbar added will then appearunder the previous toolbar. However, many times it is useful to dock atoolbar next to another on the same row using code. <br><br>	In the picture below, you can see that toolbar #2 has been docked next to toolbar #1.  This was done using code.	<img src="http://localhost/support/kb_activex/commandbars/images/cb3_1.gif" align="middle" border="0">	<br><br>The code below provides a helper function that will dock a toolbar tothe right of another, regardless of the order that the toolbars areadded. This code will allow you to dock a toolbar next to anotherwheather it is vertical or horizontal.<br><br>	<b>C# Code</b>	</p><pre ="code">// C# Code<br>private void DockRightOf(XtremeCommandBars.CommandBar BarToDock, <br>            XtremeCommandBars.CommandBar BarOnLeft, Boolean VerticalBar)<br>{<br>int left, top, right, bottom;<br>XtremeCommandBars.CommandBar LeftBar = BarOnLeft;<br> <br>CommandBars.RecalcLayout();<br>LeftBar.GetWindowRect(out left, out top, out right, out bottom);<br><br>if (VerticalBar == false)<br>CommandBars.DockToolBar(BarToDock, right, <br>                        (bottom + top) / 2, LeftBar.Position);<br>else<br>CommandBars.DockToolBar(BarToDock, (left + right) / 2, <br>                        Bottom, LeftBar.Position);<br>}<br><br>/*<br>Parameters:<br>   BarToDock - ToolBar to be placed to the RIGHT of another ToolBar<br>   BarOnLeft - ToolBar that will be on the LEFT side of BarToDock<br>   VerticalBar - Set to false if the toolbars are docked at the <br>                 top or bottom of the window (horizontal), set to <br>                 true if the toolbars are on the left or right of <br>                 the window (vertical)<br><br>Sample usage:<br>   XtremeCommandBars.CommandBar ToolBar1, ToolBar2;<br>   //..........Add controls to toolbars<br>   DockRightOf(ToolBar2, ToolBar1, false);<br>*/<br></pre><br><b>VB6 Code</b><pre ="code">' VB6 Code<br>Private Sub DockRightOf(BarToDock As CommandBar, _<br>                        BarOnLeft As CommandBar, VerticalBar As Boolean)<br>    Dim Left As Long<br>    Dim Top As Long<br>    Dim Right As Long<br>    Dim Bottom As Long<br>    Dim LeftBar As CommandBar<br>    <br>    Set LeftBar = BarOnLeft<br>    <br>    CommandBars.RecalcLayout<br>    BarOnLeft.GetWindowRect Left, Top, Right, Bottom<br>    <br>    LeftBar.GetWindowRect Left, Top, Right, Bottom<br><br>    If (VerticalBar = False) Then<br>        CommandBars.DockToolBar BarToDock, Right, _<br>                                (Bottom + Top) / 2, LeftBar.Position<br>    Else<br>        CommandBars.DockToolBar BarToDock, (Left + Right) _<br>                                / 2, Bottom, LeftBar.Position<br>    End If<br>End Sub<br><br>'Parameters:<br>'   BarToDock - ToolBar to be placed to the RIGHT of another ToolBar<br>'   BarOnLeft - ToolBar that will be on the LEFT side of BarToDock<br>'   VerticalBar - Set to false if the toolbars are docked at the <br>'                 top or bottom of the window (horizontal), set to <br>'                 true if the toolbars are on the left or right of <br>'                 the window (vertical).<br><br>'Sample usage:<br>'   Dim ToolBar1 As CommandBar, ToolBar2 As CommandBar<br>'   ..........Add controls to toolbars<br>'   DockRightOf ToolBar2, ToolBar1, False<br></pre><br>]]>
   </description>
   <pubDate>Wed, 26 Oct 2005 11:56:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=9253&amp;title=how-to-add-the-second-toolbar-next-to#9253</guid>
  </item> 
  <item>
   <title><![CDATA[How to add the sec&#111;nd toolbar NEXT TO : Thought this might be useful...had...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=9136&amp;title=how-to-add-the-second-toolbar-next-to#9136</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 2741<br /><strong>Posted:</strong> 19 October 2005 at 12:14pm<br /><br />Thought this might be useful...had it laying around from another help request.&nbsp; It allows toolbars to be docked text to each other when vertical as well:<br><br>You can use this helper function to dock a toolbar to the right of another:<br><br>		private void DockRightOf(XtremeCommandBars.CommandBar BarToDock, XtremeCommandBars.CommandBar BarOnLeft, Boolean VerticalBar)<br>		{<br>			int left, top, right, bottom;<br>			XtremeCommandBars.CommandBar LeftBar = BarOnLeft;<br>&nbsp; <br>			CommandBars.RecalcLayout();<br>			LeftBar.GetWindowRect(out left, out top, out right, out bottom);<br><br>			if (VerticalBar == false)<br>				CommandBars.DockToolBar(BarToDock, right, (bottom + top) / 2, LeftBar.Position);<br>			else<br>				CommandBars.DockToolBar(BarToDock, (left + right) / 2, Bottom, LeftBar.Position);<br>		}<br><br>Parameters:<br>&nbsp;&nbsp; BarToDock - ToolBar to be placed to the RIGHT of another ToolBar<br>&nbsp;&nbsp; BarOnLeft - ToolBar that will be on the LEFT side of BarToDock <br>&nbsp;&nbsp;VerticalBar - Set to false if the toolbars are docked at the top orbottom of the window (horizontal), set to true if the toolbars are onthe left or right of the window (vertical).<br><br>Sample usage:<br>&nbsp;&nbsp; XtremeCommandBars.CommandBar ToolBar, ThemesBar;<br>&nbsp;&nbsp; //..........Add controls to toolbars<br>&nbsp;&nbsp; DockRightOf(ThemesBar, ToolBar, false);<br>]]>
   </description>
   <pubDate>Wed, 19 Oct 2005 12:14:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=9136&amp;title=how-to-add-the-second-toolbar-next-to#9136</guid>
  </item> 
  <item>
   <title><![CDATA[How to add the sec&#111;nd toolbar NEXT TO : Found my solution from SuperMario&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=8199&amp;title=how-to-add-the-second-toolbar-next-to#8199</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1405">Onur</a><br /><strong>Subject:</strong> 2741<br /><strong>Posted:</strong> 17 August 2005 at 11:27pm<br /><br />Found my solution from SuperMario's answer to another post..<BR>Re-syntaxeed for C#..<BR><BR><FONT color=#0000ff size=2><P>private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> DockToolbarOnRightOf(CommandBar BarToDock, CommandBar BarOnLeft)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> left, top, right, bottom;</P><P>CommandBars.RecalcLayout();</P><P>BarOnLeft.GetWindowRect(</FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> left, </FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> top, </FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> right, </FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> bottom);</P><P>CommandBars.DockToolBar(BarToDock, right, (bottom + top) / 2, BarOnLeft.Position);</P><P>}</P></FONT>]]>
   </description>
   <pubDate>Wed, 17 Aug 2005 23:27:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=8199&amp;title=how-to-add-the-second-toolbar-next-to#8199</guid>
  </item> 
  <item>
   <title><![CDATA[How to add the sec&#111;nd toolbar NEXT TO : Hi, How do I&amp;#034;add&amp;#034; the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=8198&amp;title=how-to-add-the-second-toolbar-next-to#8198</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1405">Onur</a><br /><strong>Subject:</strong> 2741<br /><strong>Posted:</strong> 17 August 2005 at 10:37pm<br /><br /><P>Hi,</P><P>How do I&nbsp;"add" the second toolbar right&nbsp;NEXT TO the first one?<BR>The code is:</P><FONT face="Courier New, Courier, mono"><FONT size=2><P>CommandBar TB1 = CommandBars.Add("Toolbar 1", XTPBarPosition.xtpBarTop);<BR>CommandBar TB2 = CommandBars.Add("Toolbar 2", XTPBarPosition.xtpBarTop);<BR><BR>Both added to the top of the form but one under the other.<BR><BR>Thanks in advance</P></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 17 Aug 2005 22:37:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2741&amp;PID=8198&amp;title=how-to-add-the-second-toolbar-next-to#8198</guid>
  </item> 
 </channel>
</rss>