The new vbAccelerator Site - more VB and .NET Code and Controls
Source Code
2 Common Controls Library &nbsp
 

vbAccelerator Status Bar Control and No Status Bar Class

 
 

A Cool New Status Bar Control and a Lightweight Class for Low-Resource Projects

 


 NOTE: this code has been superceded by the version at the new site.



&nbsp

vbAccelerator Status Bar Control Demonstrator

Download the vbAccelerator StatusBar Control and Demonstration Project (85kb)
Download the vbAccelerator StatusBar Control and Demonstration with full source (106kb)
Download the No-Status Bar StatusBar Class and Demonstration source (34kb)

  UpdatedUpdated! 15 August 1999  
&nbsp The last release of the control (vbalSbar.OCX) only worked in the IDE, not in compiled executables. This was because a call to InitCommonControls was missing from the control's initialisation code. Now fixed. &nbsp
&nbsp Source Code Note &nbsp
&nbsp This OCX is a binary compatible component which works with all other samples. If you compile your own copy of this OCX yourself please make sure you change the name. See disclaimer and license for more details. &nbsp
&nbsp Before you Begin &nbsp
&nbsp These projects require the SSubTmr.DLL component. Make sure you have loaded and registered this before trying any project. &nbsp
&nbsp The demonstration project uses the vbAccelerator Image List as a source of images. Download and register this control to fully exercise the demo, or you can substitute a VB Image List control in its place. &nbsp

Introduction
These projects cover StatusBar controls in VB. Two different status bar methods are presented here:

  1. The first is a true COMCTL32.DLL StatusBar
  2. The second is a "No Status Bar" Status Bar class: a faked StatusBar which provides virtually all of the functionality in a smaller package which is easy to compile directly into an application and does not depend on the installed COMCTL32.DLL version.
The only disadvantage of the No Status Bar class version compared to the control is that if you press the Stop button in the VB IDE and you are using icons in the status bar panels then you will get a USER resource leak because the call to destroy the active icon handles will not be made. The effect of this in Win95/98 can be rather nasty if resources grow low enough - only the ON/OFF switch on your computer will work! (Although mine seems to work quite rather better in the off direction than the other way. An interesting choice by the PC manufacturer...)

Features
The StatusBar control supports all the standard VB5 Status Bar features. Plus:
  • Create Owner-Draw status bar sections. When you set the panel style to Owner Draw, whenever the panel needs to be drawn, the control will fire an event passing the Device Context to draw into, the panel number and the bounding rectangle. You can either draw directly into the DC using GDI API methods or draw into a VB Picture Box with AutoRedraw set to True and BitBlt the Picture Box's contents into the DC. The demonstration code includes a sample owner draw panel which fills the panel with the Swimming Pool texture and then draws a centred caption in an arbitrary colour over the top.
  • Get the rectangle of any status bar panel. You can use this to show (for example) a progress bar in the status bar.

    Download the StatusBar/Progress Demonstration Project (20kb)

    Note you do not need the download the vbAccelerator Progress Bar control separately to run this project - it has been included as code in the project.
In addition to these methods, if you have COMCTL32.DLL v4.71 or higher then the following features are also available:
  • Tooltip support. The control will display tooltips if the status bar panel has an icon and no text or if it has a panel with an icon and text and not all the text is visible.
  • Add an icon to each status bar panel from a Image List (either a COMCTL32.OCX ImageList, a vbAccelerator Image List or hImageList handle.
  • Change the status bar background colour
  • Change tab alignment or from tab to button style at run-time.
  • Implements hot-tracking (mouse-over highlighting) of tabs.
  • Make buttons appear flat, with optional flat toolbar-style separators.
  • Easily add, insert and remove tabs.
  • Responds to right clicks in the tab area, allowing custom menus to be shown.
How to Use the Control
Documentation for the Status Bar Control is available in Rich text format. This documentation was created using the ActiveX Documenter which is also available for download.

Download or View the vbAccelerator StatusBar Documentation (11kb)

The No-Status Bar class shares all the methods of the status bar control, except:
  • It has no events.
  • It does not support owner draw panels.
  • It does not support pre-defined panels, such as NumLock, CapsLock, Date/Time and so on. Check the source code for the full Status Bar if you want a hint on building these items.




TopBack to top
Source Code - What We're About!Back to Source Code

&nbsp
 

About  Contribute  Send Feedback  Privacy

Copyright © 1998-1999, Steve McMahon ( steve@vbaccelerator.com). All Rights Reserved.
Last updated: 15 August 1999