unit fm_bar;
interface
uses
Forms,Classes,sysutils;
type
TSBar = class(TThread)
private
{ Private declarations }
protected
procedure Execute;
override;
end;
implementation
uses Graphics,fm_conn,data_sys_frm;
{ TSBar }
procedure TSBar.Execute;
begin
with fm_conn_frm.CBardo
begin
sleep(50);
Position:=Position+1;
if Position=100 then
position:=0;
end;
end;
在formcreate的时候启动这个线程
DSBar:=TSBar.Create(True);
DSBar.FreeOnTerminate:=true;
DSBar.Resume;