CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Toolbars

  1. #1
    Join Date
    Jul 2001
    Posts
    41

    Toolbars

    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


  2. #2
    Join Date
    Jun 2001
    Location
    Northeast Tennessee
    Posts
    15

    Re: Toolbars

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured