澳门新蒲京娱乐


word打不开如何做,双击word文书档案时通晓是不是发送错误报告怎样解决

发短信以及目录【新蒲京官方下载】,Delphi中使用TThread类实现多线程

delphi线程

新蒲京官方下载 1
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, ComCtrls, StdCtrls, Unit2;

type
TForm1 = class(TForm)
    ListView1: TListView;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
private
    { Private }
public
    { Public }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
n: integer;
fpb: TProgressThread;
begin
n := listview1.Items.Count;
with listview1.Items.Add do
begin
    Caption := format(‘%d’, [n]);
    update;
end;
fpb := TProgressThread.Create(False);
fpb.Index := n;
fpb.Resume;
end;

end.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

unit Unit2;

interface

uses
Classes, Types, ComCtrls;

type
TProgressThread = class(TThread)
private
    procedure progressupdate;
protected
    procedure Execute; override;
public
    Index: integer;
end;

implementation
uses Unit1;

procedure TProgressThread.Execute;
begin
// Synchronize(progressupdate);
progressupdate
end;

新蒲京官方下载 ,procedure TProgressThread.progressupdate;
var
r: TRect;
pb: TProgressBar;
i: integer;
begin
r := Form1.Listview1.Items[Index].DisplayRect(drBounds);
r.Left := r.Left + Form1.Listview1.columns[0].Width;
r.Right := r.Left + Form1.Listview1.columns[1].Width;
pb := TProgressBar.Create(nil);
pb.Visible := False;
pb.Parent := Form1.Listview1;
pb.BoundsRect := r;
pb.Position := 0;
pb.Max := 50000;
pb.Visible := True;
Form1.Listview1.Items[Index].Data := pb;
for i := 0 to 50000 do begin
    pb.Position := i;
end;
pb.Free;
end;

end.

相关文章

No Comments, Be The First!
近期评论
    功能
    网站地图xml地图