Click to See Complete Forum and Search --> : Toolbars


Goutam
August 15th, 2001, 10:44 AM
I have a Toolbar with 30 (buttons) icons present in it. As on when the user changes the screen I will have to hide some icons (buttons) from the Toolbar. Is there any Way to hide all the required buttons by giving their indexes in one statement instead of setting each button.visible property to false individually.

Thanks in advance

Goutam

obiwan444
August 15th, 2001, 11:50 AM
You could do something like this:

Dim iArray() As Integer
Dim nNumButtonsToHide As Integer
Dim i As Integer

nNumButtonsToHide = 5 ' the number of buttons you want to hide

ReDim iArray(1 To nNumButtonsToHide)
iArray = Array(1, 5, 10, 20, 30) ' provide all of your button indexes here

For Each i In iArray
tbToolbar.Buttons(i).Visible = False
Next