F frankwood Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-12 #1 如何编写动态创建的控件的事件: 现在我需要动态创建一个定时器,请问如何使它定时到达调用我写好的事件?
D delphi Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-12 #2 type TMyForm = class(TForm) private FTimer: TTimer; procedure MyOnTimer(Sender: TObject); public procedure CreateTimer; end; procedure TMyForm.MyOnTimer(Sender: TObject); begin end; procedure TMyForm.CreateTimer; begin FTimer := TTimer.Create; FTImer.OnTimer := MyOnTimer; end;
type TMyForm = class(TForm) private FTimer: TTimer; procedure MyOnTimer(Sender: TObject); public procedure CreateTimer; end; procedure TMyForm.MyOnTimer(Sender: TObject); begin end; procedure TMyForm.CreateTimer; begin FTimer := TTimer.Create; FTImer.OnTimer := MyOnTimer; end;