|
-
June 29th, 2001, 01:23 PM
#1
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"
-
June 29th, 2001, 02:46 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|