procedure TF_welcome.FormShow(Sender: TObject); begin progressBar:=TProgressBar.Create(F_welcome);//动态创建进度条组件progressBar with progressBar do begin // 先确定进度条组件的尺寸和位置 Top:=ProgressBarRect.Top; Left:=ProgressBarRect.Left; Width:=ProgressBarRect.Right-ProgressBarRect.Left; Height:=ProgressBarRect.Bottom-ProgressBarRect.Top; visible:=true; //使进度条可见 Parent:=StatusBar1; // parent属性设置为状态栏组件 Min:=0; // 设定进度条的范围和步长 Max:=100; Step:=10; end;
loadCur1:=LoadCursorFromFile('phone.ani'); // 加载等待动态光标 if loadCur1<>0 then begin screen.Cursors[crPhone]:=loadCur1; progressBar.StepIt; end else showmessage('加载动态光标文件(Phone)出错!');
loadCur2:=LoadCursorFromFile('MouseClick.ani'); // 加载鼠标点击动态光标 if loadCur2<>0 then begin screen.Cursors[crMouseClick]:=loadCur2; progressBar.StepIt; end else showmessage('加载动态光标文件(MouseClick)出错!');
loadCur3:=LoadCursorFromFile('phone.ani'); // 加载电话动态光标 if loadCur3<>0 then begin screen.Cursors[crPhone]:=loadCur3; progressBar.StepIt; end else showmessage('加载动态光标文件(mouseWait)出错!');
while (ProgressBar.Position < ProgressBar.Max) do begin // move the ProgressBar Position using StepIt ProgressBar.StepIt; // move by Step amount end;