<?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 : Finding a CommandBar by BarID (VB6)</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Finding a CommandBar by BarID (VB6)]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 02:19:16 +0000</pubDate>
  <lastBuildDate>Wed, 05 Dec 2007 04:43:27 +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=2914</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[Finding a CommandBar by BarID (VB6) : thanks ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2914&amp;PID=29178&amp;title=finding-a-commandbar-by-barid-vb6#29178</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3416">ylhyh</a><br /><strong>Subject:</strong> 2914<br /><strong>Posted:</strong> 05 December 2007 at 4:43am<br /><br />thanks<img src="https://forum.codejock.com/smileys/smiley1.gif" border="0">]]>
   </description>
   <pubDate>Wed, 05 Dec 2007 04:43:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2914&amp;PID=29178&amp;title=finding-a-commandbar-by-barid-vb6#29178</guid>
  </item> 
  <item>
   <title><![CDATA[Finding a CommandBar by BarID (VB6) :   The CommandBars control doesn&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2914&amp;PID=8672&amp;title=finding-a-commandbar-by-barid-vb6#8672</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1488">Milkman</a><br /><strong>Subject:</strong> 2914<br /><strong>Posted:</strong> 18 September 2005 at 1:29pm<br /><br />The CommandBars control doesn't include a function that will find aCommand Bar by BarID.&nbsp; The sample programs use the Command Barindexvalue; however, that is a limited approach.&nbsp; Use thepiece of code below to create a CommandBar object from a BarID.&nbsp; <br><br><table width="99%"><tr><td><pre class="BBcode">Private Function FindCommandBar(ByVal cbBarID As Long) As CommandBar<br>'This function returns a command bar object whose BarID matches cbBarID<br>'Declare Temporary Variables<br>Dim Bar As CommandBar<br>'Search through command bars for controls matching the ID Value<br>For Each Bar In CommandBars<br>&nbsp;&nbsp;&nbsp; If Bar.BarID = cbBarID Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Match Found<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set FindCommandBar = Bar<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit Function<br>&nbsp;&nbsp;&nbsp; End If<br>Next<br>End Function<br></pre></td></tr></table><br><br>With this piece of code you can directly access CommandBar objects through a single line of code:<br><br><table width="99%"><tr><td><pre class="BBcode">FindCommandBar(ID_STANDARD_BAR).Visible = True</pre></td></tr></table><br><br>Or perhaps in your toolbar menu commands:<br><br><table width="99%"><tr><td><pre class="BBcode">Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)<br><br>Select Case Control.Id<br>&nbsp;&nbsp;&nbsp;   CaseID_VIEW_TOOLBAR_STANDARD:&nbsp;&nbsp;&nbsp; FindCommandBar(ID_STANDARD_BAR).Visible = NotFindCommandBar(ID_STANDARD_BAR).Visible<br>End Select<br></pre></td></tr></table><br><br>If you plan on using it like this, make sure to put a line of code inthe update procedure indicate the status of the toolbar in the dropdownmenus.<br><br><table width="99%"><tr><td><pre class="BBcode">Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)<br><br>If Control Is Nothing Then Exit Sub<br>Select Case Control.Id<br>&nbsp;&nbsp;&nbsp;   CaseID_VIEW_TOOLBAR_STANDARD:&nbsp;&nbsp;&nbsp; Control.Checked = FindCommandBar(ID_STANDARD_BAR).Visible<br>End Select<br>End Sub<br></pre></td></tr></table><br><br><span style="font-size:10px"><br /><br />Edited by Milkman</span>]]>
   </description>
   <pubDate>Sun, 18 Sep 2005 13:29:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2914&amp;PID=8672&amp;title=finding-a-commandbar-by-barid-vb6#8672</guid>
  </item> 
 </channel>
</rss>