Print Page | Close Window

Looping buttons on a command bar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4919
Printed Date: 17 November 2024 at 5:55am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Looping buttons on a command bar
Posted By: PhilJeary
Subject: Looping buttons on a command bar
Date Posted: 30 August 2006 at 4:58am
Hi,
 
I'm trying to loop through the buttons on a command bar.
 
I have added a command bar using:
 
Dim ToolBar As CommandBar
Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
 
I have added a load of buttons using (for example):
 
.Add xtpControlButton, 1, "Test"
 
I now need to do something like:
 
Dim x as CommandBarControl
For each x in commandbars("standard")
  if x.id <10 then x.visible = false
Next x
 
However, I can't see to find the syntax I need for declaring X and referencing the command bar I created called "Standard".
 
Any help would be much appreciated.



Replies:
Posted By: Oleg
Date Posted: 30 August 2006 at 8:49am
Try
 
Dim x as CommandBarControl
For each x in ToolBar.Controls
  if x.id <10 then x.visible = false
Next


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net