Programming C++Builder How to Use Status Bars (TStatusBar) and Progress Bars (TProgressBar) in C Builder or Delphi?
Notice: Undefined variable: relatedArticlesCount in /home/wwwroot/ on line 149

How to use status bars and progress bars in C Builder or Delphi?

The status bars and progress bars both are belong to the Display controls in Windows Standard Components.

There are many ways to provide users with information about the state of an application. For example, some components--including TForm--have a Caption property that can be set at runtime. You can also create dialog boxes to display messages. In addition, the following components are especially useful for providing visual feedback at runtime.

Use this component or property: To do this:
TStatusBar Display a status region (usually at the bottom of a window)
TProgressBar Show the amount of work completed for a particular task
Hint and ShowHint Activate fly-by or "tooltip" help
HelpContext and HelpFile Link context-sensitive online Help

How to use status bars (TStatusBar)?

Although you can use a panel to make a status bar, it is simpler to use the status bar component. By default, the status bar's Align property is set to alBottom, which takes care of both position and size.

If you only want to display one text string at a time in the status bar, set its SimplePanel property to true and use the SimpleText property to control the text displayed in the status bar.

You can also divide a status bar into several text areas, called panels. To create panels, edit the Panels property in the Object Inspector, setting each panel's Width, Alignment, and Text properties from the Panels editor. Each panel's Text property contains the text displayed in the panel.

How to use pogress bars?

When your application performs a time-consuming operation, you can use a progress bar to show how much of the task is completed. A progress bar displays a dotted line that grows from left to right.

A progress bar

The Position property tracks the length of the dotted line. Max and Min determine the range of Position. To make the line grow, increment Position by calling the StepBy or StepIt method. The Step property determines the increment used by StepIt.

Add comment

Security code

Programming - C++Builder