procedure xx(fm:TForm);
begin
with Timage.Create(fm) do
begin
Picture.Bitmap.LoadFromFile('img\win_restore.bmp');
AutoSize:=true;
Left:=50;
top:=50;
Parent:=fm;
//onclick:=;
end;
end;
onclick后要怎么写才能关闭fm这个窗口
不要onclick后调用过程 一过程
本人一菜鸟,请教高手
begin
with Timage.Create(fm) do
begin
Picture.Bitmap.LoadFromFile('img\win_restore.bmp');
AutoSize:=true;
Left:=50;
top:=50;
Parent:=fm;
//onclick:=;
end;
end;
onclick后要怎么写才能关闭fm这个窗口
不要onclick后调用过程 一过程
本人一菜鸟,请教高手
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure MyClick(Sender:TObject);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
OnClick:=MyClick;
end;procedure TForm1.MyClick(Sender: TObject);
begin
Close;
end;end.
-----------------------------------------
http://www.kmok.cn/
假设你的主窗口是:mainformprocedure TForm1.FormClick(Sender: TObject);
begin
((Sender as TImage).Parent as TForm).Close;
end;procedure xx(fm:TForm);
begin
with Timage.Create(fm) do
begin
Picture.Bitmap.LoadFromFile('img\win_restore.bmp');
AutoSize:=true;
Left:=50;
top:=50;
Parent:=fm;
onclick:=mainform.FormClick;
end;
end;