<?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 : Add 2 toolbars in 1 line</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Add 2 toolbars in 1 line]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 12:45:55 +0000</pubDate>
  <lastBuildDate>Tue, 31 May 2005 06:06:02 +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=592</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[Add 2 toolbars in 1 line : Thank you Mario (but our princess...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=6831&amp;title=add-2-toolbars-in-1-line#6831</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=893">MarcelN</a><br /><strong>Subject:</strong> 592<br /><strong>Posted:</strong> 31 May 2005 at 6:06am<br /><br />Thank you Mario (but our princess is in another castle...),<br /><br />Since I don't know which icons belong to the toolbar items, I solved the problem another way.<br />By adding the toolbars from right to left, it's possible to dock the next toolbar on the left. For this the size of the toolbars doesn't matter :)<br /><br />I do have another question though.<br />(still using C# in Visual Studio 2005 beta 2)<br /><br />I copy some menu-items from a .net ToolStrip to a CodeJock CommandBar.<br />.net uses a ToolStripControlHost for custom controls, similar to the CommandBarControlCustom class.<br /><br />The CommandBarControlCustom class needs the handle of a control, which can be assigned via a property.<br /><br />The problem is this:<br />We have a dynamic toolbar, which can change over time. When it changes the entire CommandBar is cleared, and new controls are added. Whenever a CommandBarControlCustom item is present and the CommandBar is cleared + filled again, the custom control is still visible (but not usable)<br /><br />By moving over the control with the mouse the application crashes with the following error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt"<br /><br />It only occurs when CommandBarControlCustom items are used.<br /><br />Does the CommandBarControls.DeleteAll() method release all the handles to controls properly? Or could there be another problem (and solution)?<br /><br />==== EDIT ====<br />By manually releasing the handles of CommandBarControlCustom items, it does work as expected.<br /><br /><table width="99%"><tr><td><pre class="BBcode">for (int i = 1; i &lt; this.m_BarDynamic.Controls.Count; i++)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (!(this.m_BarDynamic.Controls<em> is CommandBarControlCustom))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  continue;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;CommandBarControlCustom control = this.m_BarDynamic.Controls<em> as CommandBarControlCustom;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;IntPtr Handle = new IntPtr(control.Handle);<br />&nbsp;&nbsp;&nbsp;&nbsp;if (Handle == IntPtr.Zero)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  continue;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;NativeWindow window = NativeWindow.FromHandle(Handle);<br />&nbsp;&nbsp;&nbsp;&nbsp;window.DestroyHandle();<br />}<br /></pre></td></tr></table><br /><br />==== EDIT ====<br /><br />More progress...<br />I created a CommandBarControlCustom object with a Handle to a .net TextBox. This worked, the textbox was shown correctly :)<br /><br />One problem does occur though. When another CommandBarControl is added AFTER the Custom control, the backspace key doesn't work.<br /><br />Even worse, there are some focus problems with custom .net UserControls in a CommandBarControlCustom object. This always occurs, even when the Custom control isn't followed by another control.<span style="font-size:10px"><br /><br />Edited by MarcelN</span>]]>
   </description>
   <pubDate>Tue, 31 May 2005 06:06:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=6831&amp;title=add-2-toolbars-in-1-line#6831</guid>
  </item> 
  <item>
   <title><![CDATA[Add 2 toolbars in 1 line : I don&amp;#039;t have VS 2005 Beta...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=6776&amp;title=add-2-toolbars-in-1-line#6776</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 592<br /><strong>Posted:</strong> 26 May 2005 at 9:51am<br /><br />I don't have VS 2005 Beta 2 to test on, but here is the C# code I use:<br><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>Also, make sure you are adding your icons <span style="font-weight: bold;">BEFORE </span>you use this function.<br>]]>
   </description>
   <pubDate>Thu, 26 May 2005 09:51:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=6776&amp;title=add-2-toolbars-in-1-line#6776</guid>
  </item> 
  <item>
   <title><![CDATA[Add 2 toolbars in 1 line : When using this method to dock...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=6773&amp;title=add-2-toolbars-in-1-line#6773</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=893">MarcelN</a><br /><strong>Subject:</strong> 592<br /><strong>Posted:</strong> 26 May 2005 at 7:41am<br /><br /><P>When using this method to dock a toolbar to the right, it's still positioned wrong.<BR>Although it is on the same line as the other toolbar, it's positioned too far to the right. (We're using C#, Visual Studio 2005 Beta 2)</P><P>I debugged our application and found the values returned from GetWindowRect to be very weird:<BR>left:&nbsp;2700<BR>top:&nbsp;3330<BR>right:&nbsp;11070<BR>bottom:&nbsp;3735</P><P>Also, the width of the toolbar is too large.<BR>Width:&nbsp;32767</P><P>Are these&nbsp;values in pixels? The values seem&nbsp;a bit high.</P><P>I do have a multi-monitor setup, but after disabling my second monitor it still wouldn't work correctly.</P><P><IMG src="uploads/MarcelN/2005-05-26_073937_toolbars.png" border="0"></P><P>These toolbars should be aligned next to eachother, not that far apart.<BR>Is there a solution for this problem, or are&nbsp;we doing something wrong?</P>]]>
   </description>
   <pubDate>Thu, 26 May 2005 07:41:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=6773&amp;title=add-2-toolbars-in-1-line#6773</guid>
  </item> 
  <item>
   <title><![CDATA[Add 2 toolbars in 1 line : Look at CommandBars dynamic popup...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=1511&amp;title=add-2-toolbars-in-1-line#1511</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 592<br /><strong>Posted:</strong> 01 April 2004 at 11:58am<br /><br />Look at CommandBars dynamic popup sample.&nbsp; Copy the code below toa new project and add a CommandBars control and ImageList control ifyou want images:<br><br>Private Sub DockRightOf(BarToDock As CommandBar, BarOnLeft As CommandBar)<br>&nbsp;&nbsp;&nbsp; Dim Left As Long<br>&nbsp;&nbsp;&nbsp; Dim Top As Long<br>&nbsp;&nbsp;&nbsp; Dim Right As Long<br>&nbsp;&nbsp;&nbsp; Dim Bottom As Long<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; CommandBars.RecalcLayout<br>&nbsp;&nbsp;&nbsp; BarOnLeft.GetWindowRect Left, Top, Right, Bottom<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; CommandBars.DockToolBar BarToDock, Right, (Bottom + Top) / 2, BarOnLeft.Position<br><br>End Sub<br><br>Private Sub Form_Load()<br><br>&nbsp;&nbsp;&nbsp; Dim Control As CommandBarControl<br>&nbsp;&nbsp;&nbsp; Dim ControlFile As CommandBarPopup<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&amp;File", -1,0)<br>&nbsp;&nbsp;&nbsp; With ControlFile.CommandBar.Controls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Add xtpControlButton, ID_FILE_NEW, "&amp;New", -1, False<br>&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Dim ToolBar As CommandBar<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Set ToolBar = CommandBars.Add("Standard", xtpBarTop)<br>&nbsp;&nbsp;&nbsp; With ToolBar.Controls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Control = .Add(xtpControlButton, ID_FILE_NEW, "&amp;New", -1, False)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control.DescriptionText = "Create a new document"<br>&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Dim ExtendedBar As CommandBar<br>&nbsp;&nbsp;&nbsp; Set ExtendedBar = CommandBars.Add("Extended", xtpBarTop)<br>&nbsp;&nbsp;&nbsp; With ExtendedBar.Controls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Control = .Add(xtpControlSplitButtonPopup, ID_TOOLS_UNDO, "Undo")<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Control.CommandBar.Controls.Add xtpControlButton, ID_TOOLS_UNDO, "Undo"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Add xtpControlComboBox, ID_TOOLS_UNDO_COMBO, "Undo Combo"<br>&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; CommandBars.AddImageList imlToolbarIcons<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; DockRightOf ExtendedBar, ToolBar<br>End Sub<br><span style="font-size:10px"><br /><br />Edited by SuperMario</span>]]>
   </description>
   <pubDate>Thu, 01 Apr 2004 11:58:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=1511&amp;title=add-2-toolbars-in-1-line#1511</guid>
  </item> 
  <item>
   <title><![CDATA[Add 2 toolbars in 1 line : Hi all! I cannot find solution...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=1509&amp;title=add-2-toolbars-in-1-line#1509</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=425">Voha</a><br /><strong>Subject:</strong> 592<br /><strong>Posted:</strong> 01 April 2004 at 11:37am<br /><br /><P>Hi all!</P><P>I cannot find solution how to add 2nd toolbar near 1st. It always add next toolbar below the previous.&nbsp;I dock them all at the top.</P><P>In Infragistics ActiveToolBar there is a solution when DocRow and DockColumn properties should be specified. </P><P>May be i just missed somethig? But there is no any axample where tollbars whould be loaded in such way. But it is possible to move 2nd toolbar manualy . So i think sulution exist but i just cannot find it.</P><P>tnx.</P><P>Voha</P>]]>
   </description>
   <pubDate>Thu, 01 Apr 2004 11:37:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=592&amp;PID=1509&amp;title=add-2-toolbars-in-1-line#1509</guid>
  </item> 
 </channel>
</rss>