Status Bar DEMO - Version 2.00 (If you can call it that!)

By:  M. J.  Rodriguez     CIS ID: 100321,620
                        Internet: 100321.620@compuserve.com
                                  jrodrigu@cpd.hqusareur.army.mil


This compressed file contains five files:

FORM1.FRM 	- Demo Form for the project
PROJECT1.MAK 	- MAK file for the Project
STATBAR2.BAS 	- Routines for the Status Bar
README.TXT	- This File
VB_SBAR2.EXE	- EXE of the Demo

The code contained in these files are free.  This is just my contribution to 
all those who have shared code for free!  Enjoy.

This is my upgrade/revision/improvement over the previous files I uploaded 
that shows how to create a Status Bar in VB with just a Picture Control, a 
Timer, and a Label.  This code does it without the label!

I have modularized this code to the point where you should be able to just 
drop it into your projects and go.  If you have any problems let me know.


In order for this to work all you need is a form, a picture box, and 
a timer.   Do the following.

Create a form.

Set the KeyPreview Property to True.

In the Form_KeyDown() Event, add the following snippet:

	UpdateKeyPanels StatPanel, sb_panels()

In the Form_Load() Event, add the following snippet:

	Dim iSuc%

	CreatePanels sb_panels()
	iSuc% = InitializeStatusBar(Me, sb_panels())
	sb_initialize = True

In the General Declarations Section add the following lines

Dim sb_panels() as cPanelData
Dim sb_initialized as Integer

Add a picturebox with the following properties set:
	Name - StatPanel

In the Resize Event of the PictureBox add the following code snippet:
	If Me.WindowState <> 1 Then
    		If sb_initialized Then DisplayStatusBar Me.StatPanel, sb_panels()
	End If

Add a Timer Control with the following properties set:
	Name=StatTimer	
	Enabled = False
	Interval = 200

In the Timer Event add the following code snippet
	UpdateStatusPanels StatPanel, sb_panels()


In this code, a status bar is divided into panels.  Each panel is an element 
of an array of type cPanelData (see the STATBAR2.BAS file for the 
description).  Order of how the panels are placed are also dependent on you.  
You set the panel descriptions and the order in the CreatePanels procedure.  
(see the procedure on the STATBAR2.BAS on how to configure the panels.)
If you want to use multiple forms, then cut and paste the CreatePanels 
procedure into each form's General Declaration section.  I have tried these 
using MDI forms with many child forms and it seems to work with no problem.  
At least, I haven't had it crash as of yet.

Below are the types of panels in the code.

SBAR_TEXT - Panel Containing only Text (Dynamic width - changes during a 
resize event.  All others are static)
SBAR_DATE - Panel that displays the date.
SBAR_TIME - Panel that displays the time.
SBAR_CAPSLOCK - Panel that displays the current status of the CAPSLOCK key
SBAR_NUMLOCK - Panel that displays the current status of the NUMLOCK key
SBAR_SCROLL - Panel that displays the current status of the SCROLL LOCK key
SBAR_COUNTER - Panel that displays counts.. for whatever. - it's right aligned.

The SBAR_TEXT panel has dynamic width in that its width changes when you 
resize the Form.  All others maintain there width, regardless of the size of 
the form.  The SBAR_TEXT types are easily lost in real small windows, but if a 
user decides to reduce the window size to a point where you can't see it anyway, 
what difference does it make?

Some Notes on the Code:
--------------------------
This code works fairly consistently but is intentionally left ambiguous so 
that you can modify it for your needs.  This is just merely a template and 
there are other ways to use it.  You certainly can add more types of panel 
properties, or settings or types, or whatever.  The idea behind this whole 
thing was to provide something that is easy to use and effective without 
having to add a VBX and yet increase functionality.

All of the code is documented in such a way as to explain each function and 
how you can use it.  I have tried to modularize it in such a way to make it 
easy to incorporate.  My library files are getting larger and larger and so  
now, when I need some functionality, I just add the file, make the calls and 
voila'.. a new program.  This code is the work of some of that library work 
and is for your use.  This is just my way of returning a little bit back to 
all those who I have learned and borrowed.

If you have any questions, or comments, please send them to me.  If you use 
this in a program and improve it, let me know.. I just want to see what you 
did!

I MAKE NO WARRANTY EITHER EXPRESSED OR IMPLIED ON THE RELIABILITY OR 
USEFULNESS OF THIS PRODUCT.  I ASSUME NO LIABILITY OR RESPONSIBILITY FOR ANY 
DAMAGES CAUSED BY USE OF THIS PRODUCT.  THE USER ASSUMES ALL RISK FOR USE OF 
THIS PRODUCT.



