Style Property (Panel Object) Example

This example displays data in the various styles on a StatusBar control. To try this example, place a StatusBar control on a form and paste the code into the form's Declarations section, and run the example.

Private Sub Form_Load()
   ' Dim variables.
   Dim I as Integer
   Dim pnlX as Panel
   
   For I = 1 to 5   ' Add 5 panels.
      Set pnlX = StatusBar1.Panels.Add( ) 
   Next I

   ' Set the style of each panel.
   With StatusBar1.Panels
      .Item(1).Style = sbrDate    ' Date
      .Item(2).Style = sbrTime    ' Time
      .Item(3).Style = sbrCaps    ' Caps lock
      .Item(4).Style = sbrNum   ' Number lock
      .Item(5).Style = sbrIns    ' Insert key
      .Item(6).Style = sbrScrl    ' Scroll lock
   End With
   Form1.Width = 9140 ' Widen form to show all panels.
End Sub