//创建进度条
procedure TFrmExcel.createprogressbar;
begin
if not Assigned(ProgressBar) then
Progressbar:=TProgressBar.Create(Self);
Repaint;
with ProgressBar do
begin
Top:=StatusDrawRect.Top;
Left:=StatusDrawRect.Left;
Width:=StatusDrawRect.Right-StatusDrawRect.Left;
Height:=StatusDrawRect.Bottom-StatusDrawRect.Top;
Visible:=true;
Parent := StatusBar;
end;
end;
这样就在状态栏上有一个进度条
你可以参照这样的加其他VCL控件
下边的代码是把一个ComBobox加到status上,
begin
with TComBobox.Create(StatusBar1)do
begin
Parent:=StatusBar1;
width:=StatusBar1.Width;
height:=StatusBar1.Height;
Text:='Test';
end;
end;