unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
showmessage('ssss'); //为什么这里的代码不会执行呢?
end;end.
设计时状态,选中form,然后在OnShow事件下拉框中选择FormShow
或者在代码中指定:OnShow = FormShow;
OnShow = FormShow;