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

Thread: Unload toolbar

  1. #1
    Join Date
    Mar 2000
    Location
    canada
    Posts
    60

    Unload toolbar

    Hi, i would like peace of code to be able to unload a toolbar in a form.

    Thanks in advance

    "the opposition of the opposites is the engine of becoming"

  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Unload toolbar

    If the toolbar is created at DEsign time, you can't. The best you can do is set its .Visible property to False.
    If the Toolbar was created at run time then you can use the remove method to do so.
    Here is a sample. Start a new project. Add a toolbar and three command buttons.
    Paste this code into the general declaration serction of the form. Run it

    private Sub Command1_Click()
    ' Make IDE created toolbar invisible
    Toolbar1.Visible = false
    End Sub

    private Sub Command2_Click()
    ' Create a toolbar at run time
    Dim tbr as Toolbar
    set tbr = Form1.Controls.Add("MSComctlLib.Toolbar", "tbr1")
    tbr.Visible = true
    tbr.Align = vbAlignBottom
    tbr.BorderStyle = ccFixedSingle
    tbr.Buttons.Add , "A", "A"
    End Sub

    private Sub Command3_Click()
    ' Remove run time created toolbar
    Form1.Controls.Remove "tbr1"
    End Sub




    John G

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