Results 1 to 4 of 4

Thread: [2005] Toolbar - Hiding Buttons

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    [2005] Toolbar - Hiding Buttons

    Hello,

    I wonder if anyone can help me please ?

    I have a toolbar on my application that has a series of buttons on, each calling different forms.

    What I'd like to do is hide one or two of the buttons depending on the users access level, so for example if they were an access level 3, they would see the buttons, but anything less, then they wouldn't.

    Can this be done ?

  2. #2
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: [2005] Toolbar - Hiding Buttons

    Not sure if you can hide it but you can set the Enabled Property.

    When the Enabled property is set to false, the toolbar button cannot be clicked, and the button's appearance changes. The Image and Text assigned to the button appear grayed out. If the image or text has multiple colors, they display in a monochromatic gray.

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: [2005] Toolbar - Hiding Buttons

    Just set the visible property of the toolbar button to false...

    vb Code:
    1. ToolstripButton1.Visible = False

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Toolbar - Hiding Buttons

    How do you normally hide something on a Windows form? The Visible property maybe?
    vb.net Code:
    1. If accessLevel < 3 Then
    2.     Me.ToolStripButton1.Visible = False
    3. End If
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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