其中Progress: TProgressBar;在TForm1 = class(TForm)中定义
function TForm1.CreateProgress():boolean;
var
staPanleWidth:integer;
begin
progress:=TProgressbar.create(form1);
staPanleWidth:=statusbar1.Panels.Items[2].width;
statusbar1.Panels.Items[2].width:=150;
statusbar1.repaint;
with progress do
begin
top:=StatusDrawRect.top;
left:=StatusDrawRect.left;
width:=StatusDrawRect.right-StatusDrawRect.left-2;
height:=StatusDrawRect.bottom-StatusDrawRect.top-2;//设定进程条的宽
visible:=true;
Parent := statusbar1;
end;
statusbar1.Panels.Items[2].width:=staPanleWidth;
result:=true;
end;procedure TForm1.DrawProgress(stepvar :integer;stop:boolean);
begin
progress.Step:=100 div stepvar ; //进程条的步长
if not stop then
progress.StepIt;// 进程条累加
if stop then
progress.Free;end;
function TForm1.CreateProgress():boolean;
var
staPanleWidth:integer;
begin
progress:=TProgressbar.create(form1);
staPanleWidth:=statusbar1.Panels.Items[2].width;
statusbar1.Panels.Items[2].width:=150;
statusbar1.repaint;
with progress do
begin
top:=StatusDrawRect.top;
left:=StatusDrawRect.left;
width:=StatusDrawRect.right-StatusDrawRect.left-2;
height:=StatusDrawRect.bottom-StatusDrawRect.top-2;//设定进程条的宽
visible:=true;
Parent := statusbar1;
end;
statusbar1.Panels.Items[2].width:=staPanleWidth;
result:=true;
end;procedure TForm1.DrawProgress(stepvar :integer;stop:boolean);
begin
progress.Step:=100 div stepvar ; //进程条的步长
if not stop then
progress.StepIt;// 进程条累加
if stop then
progress.Free;end;
解决方案 »
- 《程序員之打油詩》---看後有點傷感
- 小问题,高手请进 打印预览显示比例的设置?
- 关于一个日期时间计算的问题
- 高价跪求文件管理系统算法!!!!(100分在线急求)
- 查询数据随机排序怎么做?
- 關于動態產生tmonthcalendar使用的問題﹖
- ClientSocket在发送数据的时候,ServerSocket能接收数据吗?
- 字符串超过上万字节怎么就是乱码了?
- 超级弱智问题:看来得找找面向对象的资料详细学学了! 关于动态建立对象!!!!!
- *都说L连接SQL SERVER ,ADO 比 BDE 好?到底好到那里?*
- 如何有效率的对数值排序?
- TInterfacedObject与TInvokableClass的区别
Var
Button:Tbutton;
Begin
Button:=Tbutton.Create(self);
Button.parent:=Form1;
Button.left:=0;
Button.top:=0;
Button.caption:='OK';end;
statusbar1.height := 20;
statusbar1.Panels.Items[0].Text := '';
statusbar1.Panels.Items[1].Text := '';注意最后要释放内存:
statusbar1.Free;
你看看一位大哥给我的代码
procedure TForm1.FormCreate(Sender: TObject);
begin
MailServ :=TMailSlot.Create(self);
MailServ.OnReceiveData := RevData;
MailServ.CreateSlot('\\.\mailslot\Test');
MailServ.Active :=False;end;
其中mailslot是一个控件