Click to See Complete Forum and Search --> : Adding a toolbar to my MDI form
Gimpster
Nov 11th, 1999, 05:47 AM
How do I add a toolbar to an MDI form, or any form for that matter? I want it to look and behave like a professional program. The toolbar size and layout of the toolbar in IE (the top toolbar with the "Back", "Forward", "Stop", "Refresh", etc. buttons) would be PERFECT! I need to know how to recreate it. Please give me code samples too. Thank you so much.
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
Serge
Nov 11th, 1999, 05:40 PM
Add a reference to Microsoft Common Controls. Toolbar control is part of that control collection. So, after you add the reference, add Toolbar control (from the Toolbox) to your form. Also, add an ImageList control to your form (it's also part of Common Controls). Right click on the new ImageList and select Properties. Select Images tab. Then click on Add button. From the CommonDialog select the icon(s) of your choice. Note that each icon will have the index (starting from 1). After selecting all the icons you want, click on OK button. Now, right click on the new Toolbar on your form and select properties. From the ImageList combobox select the name of your ImageList control.Then select Buttons tab. Click on Insert Button then fill in the Caption (if needed) Key (this must be unique to every button) and type in the number (Index of the Icon in the ImageList) in the Image textbox. Click insert button again to create another one and so on....
Note: Always fill in the Key textbox so then you can recognize the button by checking the Key property. Lets say you added 4 buttons with the Key: Back, Forward, Refresh, Stop
Now, programming part. You would have to double click on the toolbar, by default it will open ButtonClick event.
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "Forward"
'Do your forward operation
Case "Back"
'Do your back operation
Case "Stop"
'Do your stop operation
Case "Refresh"
'Do your refresh operation
End Select
End Sub
I hope this explains everything you need to get you started.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
Serge
Nov 12th, 1999, 01:29 AM
Yes, unfortunately, you don't have those controls with Learning Edition. You would have to upgrade to Professional or Enterprise Edition of VB.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
Yonatan
Nov 12th, 1999, 01:50 AM
Are UserControls available in the Learning Edition? Because vbAccelerator (http://www.vbaccelerator.com) have a great ReBar control!
------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
Gimpster
Nov 12th, 1999, 02:05 AM
No, Learning Edition doesn't have User Controls, either. Is there no other way to create a toolbar?
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
Gimpster
Nov 12th, 1999, 03:49 AM
Hey, I found the Common Controls you were talking about Serge. They are not a reference, they are a component, and they are actually called "Microsoft Windows Common Controls" They have versions 5.0 and 6.0 and both have two parts to them. They ARE available in the Learning Edition. Thanks for the tip!
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
Serge
Nov 12th, 1999, 06:31 AM
Even if you add control by adding components, it still called reference. Just an FYI.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
Gimpster
Nov 12th, 1999, 06:33 AM
Ok, my bad. I'm still kinda new to this, so I'm still picking up on all the terms that everyone uses. I just went by what they were called in the VB menus.
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
Gimpster
Nov 12th, 1999, 11:01 AM
I can't find Microsoft Common Controls in the references list. The closest I can find is Microsoft Common Dialog Controls, but that's in the COMPONENTS list. Could it be that I don't have that reference because I'm only using Learning Edition? If so, what edition do I need in order to have that reference? Thank you for your help so far.
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.