紫
紫竹林23424
Unregistered / Unconfirmed
GUEST, unregistred user!
unit frm_begin
Thread;
http://v.ku6.com/show/LctRYoKchfqCdhu3.html
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TFrmbegin
Thread = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
LbCount: TLabel;
LBCount2: TLabel;
Button1: TButton;
Bevel1: TBevel;
procedure Button1Click(Sender: TObject);
private
//function ThreadRun(Parameter: Pointer): Integer;
{ Private declarations }
public
{ Public declarations }
end;
var
Frmbegin
Thread: TFrmbegin
Thread;
implementation
{$R *.dfm}
function ThreadRun(Parameter: Pointer): Integer;
//声明函数,格式必须如此
var
i:integer;
//用于去值范围
begin
for i:=0 to 1000do
//循坏取值范围在0到1000
begin
Frmbegin
Thread.LbCount.Caption:=inttostr(i);
//在标签内显示i的数字
sleep(100);
//停止1妙
end;
end;
function ThreadRun2(Parameter: Pointer): Integer;
var
i:integer;
begin
for i:=0 to 1000do
begin
Frmbegin
Thread.LbCount2.Caption:=inttostr(i);
sleep(200);
end;
end;
[red]//下面是问题[/red]
procedure TFrmbegin
Thread.Button1Click(Sender: TObject);
var
s:TThreadFunc;
ID,ID2:cardinal;
begin
ID:=1001;
// 不知道什么意思
ID2:=ID+1;
// 同上
begin
Thread(nil,0,ThreadRun,nil,1002,ID);
begin
Thread(nil,0,ThreadRun2,nil,1002,ID2);
end;
end.
//请高手解答
Thread;
http://v.ku6.com/show/LctRYoKchfqCdhu3.html
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TFrmbegin
Thread = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
LbCount: TLabel;
LBCount2: TLabel;
Button1: TButton;
Bevel1: TBevel;
procedure Button1Click(Sender: TObject);
private
//function ThreadRun(Parameter: Pointer): Integer;
{ Private declarations }
public
{ Public declarations }
end;
var
Frmbegin
Thread: TFrmbegin
Thread;
implementation
{$R *.dfm}
function ThreadRun(Parameter: Pointer): Integer;
//声明函数,格式必须如此
var
i:integer;
//用于去值范围
begin
for i:=0 to 1000do
//循坏取值范围在0到1000
begin
Frmbegin
Thread.LbCount.Caption:=inttostr(i);
//在标签内显示i的数字
sleep(100);
//停止1妙
end;
end;
function ThreadRun2(Parameter: Pointer): Integer;
var
i:integer;
begin
for i:=0 to 1000do
begin
Frmbegin
Thread.LbCount2.Caption:=inttostr(i);
sleep(200);
end;
end;
[red]//下面是问题[/red]
procedure TFrmbegin
Thread.Button1Click(Sender: TObject);
var
s:TThreadFunc;
ID,ID2:cardinal;
begin
ID:=1001;
// 不知道什么意思
ID2:=ID+1;
// 同上
begin
Thread(nil,0,ThreadRun,nil,1002,ID);
begin
Thread(nil,0,ThreadRun2,nil,1002,ID2);
end;
end.
//请高手解答