Image of Navigational Map linked to Home / Contents / Search 95 Style Status Bar for Windows 3.11

Listing 6 looks like this...
Image of Line Break

Option Explicit
Dim StatusBar1 As StatusBar

Private Sub Form_Load() 
Set StatusBar1 = New StatusBar
Set StatusBar1.Canvas = picStatusBar

Dim I As Integer
For I = 1 To 2
StatusBar1.Panels.Add ' Add 2 Panel objects.
Next I

With StatusBar1.Panels
.Item(1).Style = sbrNum                      ' Number lock
.Item(2).Style = sbrCaps                     ' Caps lock
.Item(3).Style = sbrScrl                     ' Scroll lock
End With

 
' This text will be displayed when the StatusBar is in Simple style.

StatusBar1.SimpleText = "Date and Time: " & Now

End Sub


Private Sub Form_Unload(Cancel As Integer)
Set StatusBar1 = Nothing

End Sub

 
Private Sub picStatusBar_Click()             ' Status bar click event
With StatusBar1
If .Style = 0 Then
.Style = sbrSimple                           ' Simple style
Else
.Style = sbrNormal                           ' Normal style
End If

End With

End Sub

 
Private Sub picStatusBar_Paint()
If Not StatusBar1 Is Nothing Then StatusBar1.Refresh

End Sub

 
Private Sub picStatusBar_Resize()
If Not StatusBar1 Is Nothing Then StatusBar1.Refresh

End Sub


Image of Arrow linked to Previous Article
Image of Line Break
[HOME] [TABLE OF CONTENTS] [SEARCH]