如何把参数传到一个Timer的事件里 把参数定义成FORM的成本变量(最好私有)或者另定义一个过程,在Timer的事件处理中调用. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 type TForm1 = class(TForm) Timer1: TTimer; Button1: TButton; procedure Timer1Timer(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } FIndex: Integer; public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);begin Caption := IntToStr(FIndex); Inc(FIndex);end;procedure TForm1.Button1Click(Sender: TObject);begin FIndex := 0;end; 我这样写也不知,QR是全局变量public procedure MyQR(var mQR:TADOQuery);procedure TForm1.MyQR(var mQR: TADOQuery);begin QR:=mQR;end;procedure TForm1.Timer1Timer(Sender: TObject);begin QR...;;;end; procedure TForm1.Timer1Timer(Sender: TObject);begin if Assigned(QR) then //你的写也可以//建议加个判断 {};end; Assigned()//判断变量是否分配了内存资源 多谢zswang(伴水)(需要充充电) ,这个我知道,我是在MyQR里触发Timer1的,其它一真关闭,但不行,我是在第三个窗体上调用这个过程,而数据集即参数(vQR)是在第二个窗体上 每个控件不是有一个Tag属性吗,可以作为整形参数来用啊procedure TForm1.Timer1Timer(Sender: TObject);begin .... Timer1.Tag := ...(当参数) end; 出题:这两个结构的大小是多少? 如何对数组进行处理!!! 能根据自己的需要设置磁盘分区卷的序列号吗? 如何使用下列第三方控件? 今天论文答辩过关,大家同喜 在Delphi中如何使用控件组? 怎么实现单击菜单就在该菜单项前面加一个类似复选框的“对号”,再次单击后“对号”消失? 怎么将文本转化到数据库中去!! (在线等候!) 如何解决手提电脑中的delphi颜色错误 在delphi中如何打开POS机的钱箱? 移动计费系统的算法. 好像是Win98下的RichEdit容量太小?怎样解决?1
TForm1 = class(TForm)
Timer1: TTimer;
Button1: TButton;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
FIndex: Integer;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
Caption := IntToStr(FIndex);
Inc(FIndex);
end;procedure TForm1.Button1Click(Sender: TObject);
begin
FIndex := 0;
end;
public
procedure MyQR(var mQR:TADOQuery);procedure TForm1.MyQR(var mQR: TADOQuery);
begin
QR:=mQR;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
QR...;;;
end;
begin
if Assigned(QR) then //你的写也可以//建议加个判断
{};
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
....
Timer1.Tag := ...(当参数)
end;