|
In The Beginning...
In VB5, there is a toolbar control for VB included in COMCTL32.OCX. In VB6 the same thing with some UI
improvements is available in MSCOMCTL.OCX. You can also obtain a Microsoft rebar control for VB5;
it is included with VB6. These controls all have quite a nice design time interface,
and they're relatively easy to use.
...But...
If you have seen Office 97, VB, DevStudio, Win98, IE4 or IE5 (in fact, almost
any application released by Microsoft...) you will have noticed that the VB controls
just don't cut it:
- Why does my menu sit on top of the toolbar?
- Why aren't there any icons in the menus?
- Why are there no drop-down buttons in VB5?
- Why doesn't the rebar work?
- How come it is impossible to show a Chevron for a toolbar band that is too small?
- Why can't I include a Pager to scroll through my toolbar?
Manifesto
The vbAccelerator CoolMenu, Toolbar and Rebar control aims to give you this control. Your
project will look cooler, it'll weigh in at least 420kb less on disk and you'll be loved by
colleagues and users alike (possibly).
Consider:
- Do the cool things you can't with standard VB controls (or even straight MFC), such as
CoolMenus, Chevrons, choose to show captions on a button by button basis...
- If you just need a toolbar, then this is seriously lighter than the standard OCX. 160kb cf
590kb for VB5 and an outrageous 1040kb library for VB6!
Features of the vbAccelerator CoolMenu, Toolbar and Rebar Control
Here are the features of the controls:
1) The Toolbar
-
CoolMenu
Any toolbar can now act as a menu if used with the ActiveX
Popup Menu DLL. Built in Accelerator support means
you get full support for Alt- key accelerators in every button too (regardless of whether the button is a
menu button or not).
CoolMenu support is enabled for both standard forms and MDI forms. In the MDI version, you
must add the toolbar to the cToolBarHost control included with the package, and set the
cToolbarHost's MDIMenu property.
-
Drop Down Buttons
Support for both styles of drop-down buttons. Drop down buttons can show an arrow to the left with
independent events or have an integral drop-down and only raise a drop-down event.
-
List-Style Buttons
Toolbars can have the "list" style so the text appears to the right of the button image. In
addition, buttons in all types of toolbar can have the autosize style so their width is
calculated independently from the image and text on the button. No more buttons that are three
miles long just to display the text "Open"!
-
Access to System Image Lists
If these are the types of buttons you need, you get them for free from the in-built system
image lists. Also provided are view and history toolbar button images.
-
24x24 Buttons in Millions of Colours - No Problem
The VB/COM StdPicture object limitations are all banished in this control. Provide it
whatever image you want and this toolbar will display it (although multi colour icons are
only supported for systems with >8 bits/pixel display). The toolbar provides an in-built
method for determining the system colour depth and you can load all the button images
at the same time from a single resource bitmap, file bitmap or VB picture object. Alternatively,
you can use image lists.
And now there is a vbAccelerator Image List control and class you
don't need to worry about distributing an enormous OCX just to do it!
The demonstration downloads come with a set of Explorer and Internet Explorer 256 colour bitmaps,
in both hot and standard colours. You can get more sets of icons from the
Icon Library.
-
Toggle Text Visibility at Runtime
In List Style toolbars you can toggle text on/off for individual buttons. In a normal style toolbar,
toggling text visibility for any button automatically flips the text visibility of all the other
buttons in the bar.
-
Swap Between List and Standard Toolbar Style at Runtime
-
Set Independent Normal and Hot Button Images
Just as the Internet Explorer toolbar, when you use Image Lists as the source of toolbar
images, you can set one set of images to display when the mouse is not over the button
and another when it is. Check out the vb Accelerator Image List control
for a demonstration.
-
Smooth Display
Comctl32.OCX implements its toolbar by continually removing and re-adding buttons whenever
you change the properties. Where possible, this toolbar modifies the buttons by in-built methods
of Comctl32.Dll which make the display much smoother. The only property which causes a button
to be deleted and re-added is the ButtonCaption property. And this minimises flicker by only
removing the affected button.
The Rebar
-
Set Band Visibility
Show and hide rebar bands with a single call.
-
Chevron Support
Provided the target system has COMCTL32.DLL version 5 or higher, you can toggle Chevrons on or
off. Chevrons display when a band is too small to show the entire contents.
-
Background Bitmap
Just as you can with the toolbar control, the rebar can have any background image loaded from a
resource bitmap, a file bitmap or a VB picture object.
-
Add any control to the Rebar
Provided a control has a hWnd property, you can add it as a rebar band. If it doesn't have a
hWnd, just place it in a PictureBox and add the PictureBox to the rebar.
-
Run-time Control over minimum band sizes
-
Specify whether bands are fixed or moveable in the rebar
Getting the Best From the Control
To get the best from the control, the target system will ideally have version 4.71 or higher
of Comctl32.Dll installed. Some of the features are not supported in version 4.70, and also
Comctl32.Dll itself performs much more smoothly in subsequent versions. You can find what
version of Comctl32.Dll the target system is running using the toolbar's GetCommCtrlVersion
method (see Find which version of Comctl32.Dll you have for more
details). If you want to upgrade, visit Microsoft's MSDN site
here. (Note you must register with MSDN to follow this link, but it is free!).
Quick Start Tutorials
To get you up and running quickly with this control there are two Quick Start tutorials:
Documentation
Documentation for the CoolMenu Toolbar and Rebar control is available in RTF format. This documentation was
created with the Active X Documenter, which is also available
for download.
Click here to download/view the CoolMenu Toolbar and Rebar method and event documentation
Back to top Back to Source Code
|
  |