How to Create a Status Bar in Visual Basic

It often is helpful to display some additional information in the bottom portion of the window in computer application software. An easy way to do this in Visual Basic is with a control called the StatusBar. This control is located in the Toolbox that usually appears in the left panel when Visual Basic is running. If it is not visible, you can display it by clicking "View" and selecting the Toolbox item from the drop-down menu.

Things You'll Need

  • Visual Basic 6.0
Show More

Instructions

    • 1

      Open Visual Basic 6.0 and click on "Standard EXE" in the New Project window. If this window does not open automatically, click "File", "New Project" and select "Standard EXE" from the list of project templates.

    • 2

      Click "Project", "Components" and locate the Microsoft Windows Common Controls 6.0 (SP6) item in the list of controls. Click on the box next to these controls to put a checkmark in it, and then click "OK."

    • 3

      Look in the Toolbox expanded list of controls loaded in Step 2 and locate the StatusBar Control. This control normally appears as the fourth item from the bottom in the second column. Double-click on this control to place it on the form.

    • 4

      Right click on the StatusBar control now on the form and select "Properties" from the pop-up list to display an expanded list of properties. Click on the "Panels" tab. Enter whatever message you want to display in the "Text" box. Fill in the rest of the self-explanatory empty boxes if needed.

    • 5

      Press the "F5" function key on the keyboard to test how this looks. When you are satisfied, click "File", "Save Project as" and provide a name for the form and project. Compile this into an executable program by clicking "File" and choosing the option beginning "Make" followed by the file name you used. The program will now load and run when you double-click on it.

Tips & Warnings

  • Use the Style part of the "Panels" section property to display the state of a particular shift key like CAPS, Number, Insert or Scroll by selecting sbrCaps, sbrNum, sbrIns or sbrScr in the drop down list.

  • Display the current time or date by choosing "sbrTime" or "sbrDate" in that same Style list.

  • You can include an image in the Statusbar control as well.

  • There is a StatusBar control in the Visual Basic Express NET editions, but Microsoft recommends using the StatusStrip control instead.

  • Change the "width" property in the Panels box to match the length of the text you want to display or you will get truncated text.

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured