<?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 : DesignerC&#111;ntrols.Find gets single instanc</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : DesignerC&#111;ntrols.Find gets single instanc]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 08:35:22 +0000</pubDate>
  <lastBuildDate>Tue, 07 Dec 2004 08:14:43 +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=1117</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[DesignerC&#111;ntrols.Find gets single instanc : Mabye use a &amp;#034;For each&amp;#034;...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=4313&amp;title=designercontrols-find-gets-single-instanc#4313</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 07 December 2004 at 8:14am<br /><br />Mabye use a&nbsp; "For each" to look through ALL your controls in eachcommand bar.&nbsp; FindControl will only find first occurance no matterwhat.<br><br>But better yet, since the controls will have Id, you can set up a global variable used to indicate whenthe control should be checked/unchecked, then in the CommandBars_Updateevent you can use this variable to decide whether to checkthe control.<br><br>'Global variable<br>Dim bCheckControl as Boolean<br><br>Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;On Error Resume Next<br>&nbsp;&nbsp;Select Case Control.Id<br>&nbsp;&nbsp;&nbsp;&nbsp;Case ID_APP_ABOUT: Control.Checked = bCheckControl<br>&nbsp;&nbsp;&nbsp;&nbsp;Case ID_FILE_NEW:&nbsp;&nbsp;Control.Checked  = bCheckControl<br>&nbsp;&nbsp;End Select<br>End Sub<br>]]>
   </description>
   <pubDate>Tue, 07 Dec 2004 08:14:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=4313&amp;title=designercontrols-find-gets-single-instanc#4313</guid>
  </item> 
  <item>
   <title><![CDATA[DesignerC&#111;ntrols.Find gets single instanc : I have nearly the same problem,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=4310&amp;title=designercontrols-find-gets-single-instanc#4310</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=567">Jens4</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 07 December 2004 at 7:37am<br /><br /><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US">I have nearly the same problem, one of my customers has made his own toolbar by the custom-dialog, he has added the same control twice….<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US">I have a function that “check” the toolbar button, and in that function I use the FindContol, but I only give me the button……<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US">The tow buttons have offcures the same ID, because the user just drags then same control to the same bar.<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9.5pt; COLOR: black; FONT-FAMILY: Tahoma; mso-ansi-: EN-US">I know it is strange to have the same control on the same bar… but you know users….<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Tue, 07 Dec 2004 07:37:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=4310&amp;title=designercontrols-find-gets-single-instanc#4310</guid>
  </item> 
  <item>
   <title><![CDATA[DesignerC&#111;ntrols.Find gets single instanc : CommandBars(2).FindControl(, ID,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2923&amp;title=designercontrols-find-gets-single-instanc#2923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=658">dajv</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 01 September 2004 at 5:47pm<br /><br />CommandBars(2).FindControl(, ID, , True) is just what i needed, thanks alot!  <img border="0" src="http://forum.codejock.com/smileys/smiley1.gif" border="0"> <br /><br />]]>
   </description>
   <pubDate>Wed, 01 Sep 2004 17:47:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2923&amp;title=designercontrols-find-gets-single-instanc#2923</guid>
  </item> 
  <item>
   <title><![CDATA[DesignerC&#111;ntrols.Find gets single instanc : Top level controls can be accessed...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2920&amp;title=designercontrols-find-gets-single-instanc#2920</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=369">SuperMario</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 01 September 2004 at 6:41am<br /><br />Top level controls can be accessed with the find method.&nbsp; You mustmanually assign an Id to these controls.&nbsp; I.E (File, Edit, View,Tools, etc... are generally top level controls that display other menuitems when clicked) .<br><br>The DesignerControls<span ="highlight"></span> collection ofcommands only holds commands that are displayed in the"Commands"&nbsp;tabof the Add\remove buttons customize dialog.&nbsp; This collection isdesigned to hold all of your application's controls so the user canadd\remove them as needed. &nbsp; You need to manually add the controlsto the collection, and you should do this in the Customizationevent.&nbsp; You are looking in the wrong place if you want to find acontrol in the toolbar or menubar.<br><br>No, you do not need unique controls for the toolbar.&nbsp; Just makesure that you manually assign an Id to any control that is a popup.<br><br>When searching, try something like this:<br><br>'Searches for the first occurence of Id in all commandbars starting with the menubar<br>Commandbars.Find(,ID,True)&nbsp; <br>'Searches for the first occurence of Id in the activemenubar<br>CommandBars.ActiveMenuBar(,ID,True)<br>'or CommandBars(1).Find(,ID,True)<br>'Searches for the first occurence of Id of a top level control in the activemenubar<br>CommandBars.ActiveMenuBar(,ID)<br>'Searches for the first occurence of Id in first toolbar<br>CommandBars(2).Find(,ID,True)<br><br>Hope this helps<img src="http://forum.codejock.com/smileys/smiley1.gif" border="0"><br>]]>
   </description>
   <pubDate>Wed, 01 Sep 2004 06:41:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2920&amp;title=designercontrols-find-gets-single-instanc#2920</guid>
  </item> 
  <item>
   <title><![CDATA[DesignerC&#111;ntrols.Find gets single instanc : Further to my above situation,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2915&amp;title=designercontrols-find-gets-single-instanc#2915</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=658">dajv</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 31 August 2004 at 9:46pm<br /><br />Further to my above situation, I am having trouble getting a reference to toolbar buttons that also appear in the main menu.<br /><br />Again, I want to avoid having a seperate control for the instance that will go in the toolbar.<br /><br />I first tried using the below:<br /><table width="99%"><tr><td><pre class="BBcode">CommandBars.DesignerControls.Find(, IDR_STANDARDTEST, , True)</pre></td></tr></table><br />(where IDR_STANDARDTEST is the id of the toolbar containing the controls) but this doesn't work (and after reading other posts, i discovered that top-level menus (in this case a toolbar) can't be accessed through the find() methods.<br /><br />I then tried looping through the controls in the CommandBars.DesignerControls collection and couldn't find IDR_STANDARDTEST anywhere, nor could i find the controls that have hte toolbar as their parent, so it appears the method above i used for getting a reference to the controls used in the popup isnt going to work with the toolbar.<br /><br />I examined the Control.Parent.BarID of the controls in the toolbar (a msgbox in the Execute() event) and noticed that the parent is IDR_STANDARDTEST, so they're there somewhere...<br /><br />Must I resort to having unique controls for the toolbar?<br /><br />Any advice is appreciated.<br />]]>
   </description>
   <pubDate>Tue, 31 Aug 2004 21:46:12 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2915&amp;title=designercontrols-find-gets-single-instanc#2915</guid>
  </item> 
  <item>
   <title><![CDATA[DesignerC&#111;ntrols.Find gets single instanc : I realised that I can Find() the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2906&amp;title=designercontrols-find-gets-single-instanc#2906</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=658">dajv</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 31 August 2004 at 2:14am<br /><br />I realised that I can Find() the controls inside the popup menu and set their properties.<br /><br /><table width="99%"><tr><td><pre class="BBcode">Dim Popup As CommandBarPopup<br />Set Popup = CommandBars.DesignerControls.Find(, ID_CONTEXT_ITEM, , True)<br />Set Control = Popup.CommandBar.Controls.Find(, MenuItemID, , True)</pre></td></tr></table>]]>
   </description>
   <pubDate>Tue, 31 Aug 2004 02:14:51 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2906&amp;title=designercontrols-find-gets-single-instanc#2906</guid>
  </item> 
  <item>
   <title><![CDATA[DesignerC&#111;ntrols.Find gets single instanc : Gday,  I&amp;#039;m using Designer...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2905&amp;title=designercontrols-find-gets-single-instanc#2905</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=658">dajv</a><br /><strong>Subject:</strong> 1117<br /><strong>Posted:</strong> 31 August 2004 at 1:59am<br /><br />Gday,<br /><br />I'm using Designer Studio to create my command bars menus, and have used multiple instances of controls. Some controls in the main menu of my application also appear in context menus.<br /><br />To modify the control i get a control instance as in:<br /><table width="99%"><tr><td><pre class="BBcode"><br />Dim Control as CommandBarControl<br />Set Control = CommandBars.DesignerControls.find(, MenuItemID, , True)</pre></td></tr></table><br /><br />and use the Control instance to change properties...<br /><table width="99%"><tr><td><pre class="BBcode">Control.Visible = False</pre></td></tr></table><br /><br />When I do this, it only affects one of the instances of the controls with id MenuItemID, so an item that appears in one of the main menus as well as a context menu only gets removed (using visible = false) in the main menu, and the instance in the context menu is not affected.<br /><br />How do i get a reference to the other instances of the control (the one in the context menu)?<br /><br />I want to avoid having a seperate control for each context menu item because this will add alot of controls and their operation is exactly the same as the instance in the main menu. When the control is removed from the main menu, i want that control also removed from the context menu (the behaviour i expected initially).<br /><br />Any advice is appreciated.<br /><br />Thanks]]>
   </description>
   <pubDate>Tue, 31 Aug 2004 01:59:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1117&amp;PID=2905&amp;title=designercontrols-find-gets-single-instanc#2905</guid>
  </item> 
 </channel>
</rss>