Status Bar control plus others added to ToolBox

 

Click on Status bar Icon in Toolbox

Property Pages

3 methods to obtain :

  • Status bar selected - 
    • < View > (see menu bar at top)
    • < Property Pages >
  • Status bar selected -
    • < shift > <F4 >
  • 3rd method
    • Right click Status bar
    • < properties > (from pop-up menu)

Set up Status Bar using Property Pages

Click on 'Panel'  tab :

 

Style set to 'sbrCaps'

Enter 'Tool Tip text'

Press <OK>

Form

 

Log of Run :

 

To add another Status Bar panel :

View property page again, clicking on 'panel' tab :

Click <OK>

Form

Log of Run

 

To Add A Text Panel

 

Form

 

Log of Run

 

To Remove Panel

To Toggle the Status bar

Code:

Option Explicit

     Private Sub Form_Click()
          If staDemo.Visible = True Then
               staDemo.Visible = False
          Else
               staDemo.Visible = True
          End If
     End Sub

Log of Run :

(Toggle - i.e. click on form)

(Toggle)

Resizing the Status Bar when the User resizes a Form

Option Explicit

     Private Sub Form_Click()
          If staDemo.Visible = True Then
               staDemo.Visible = False
          Else
               staDemo.Visible = True
          End If
     End Sub

     Private Sub Form_Resize()
          If frmStatusBars.Width < 6300 Then
               frmStatusBars.Width = 6300
              'Use trial and error to find this number
          End If

        staDemo.Panels(3).Width =    
                          frmStatusBars.ScaleWidth 
                        - (staDemo.Width 
                        - staDemo.Panels(3).Width)
     End Sub

Log of Run

(Elongate form, using Mouse)

(Shorten form, using mouse)

n.b. this is the shortest the code allows the form to go.