Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Get a Progressbar in a Statusbar? 1

Status
Not open for further replies.

vacunita

Programmer
Aug 2, 2001
9,166
MX
Does anybody know how to get a Progressbar into a Statusbar?? I know that in Visual Basic all you have to do is draw it in, but here in Delphi it just jumps out onto the form. i tried to tell it that it's parent was the statusbar, but that only made it to disappear. I guessing it did get onto the statusbar, but the statusbar just doesn't show it.

Any help will be appreciated. thanx

 
You can create the progressbar at runtime.

To do so declare a global variable (pgrbar)

var
Form1: TForm1;
pgrbar : Tprogressbar ;
implementation

Modify the OnCreate Event of the form

procedure TForm1.FormCreate(Sender: TObject);
begin
pgrbar := Tprogressbar.Create(StatusBar1);
try
pgrbar.Parent := StatusBar1;
pgrbar.Min := 0;
pgrbar.Max := 100;
pgrbar.Position := 10;
pgrbar.top := 10; //y position in the Statusbar
pgrbar.left := 100; // x position in the Statusbar
finally
end;
end;


Regards S. van Els
SAvanEls@cq-link.sr
 
Or you can make your own status bar using a Panel and Edit boxes, you can drop a gauge or progress bar on to this at design time.

It's not so neat as a W32 staus bar component though.

Steve..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top