夜
夜鹰
Unregistered / Unconfirmed
GUEST, unregistred user!
unit MainF;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
Sub:TSub;
I:Integer;
begin
for I:=1 to 5 Do
begin
Sub:=TSub.Create(Self);
Sub.Parent:=Self;
Sub.Align:=alClient;
Sub.Caption:='Form ' + IntToStr(I);
Sub.Show;
end;
end;
end.
/////////////////////////////////////////////////////////////////////
unit SubF;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TSub = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Sub: TSub;
implementation
{$R *.DFM}
procedure TSub.Button1Click(Sender: TObject);
begin
ShowMessage(Self.Caption);
end;
end.
关闭或 打开几个窗体后,怎么判断当前的最上面的可视子窗体?
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
Sub:TSub;
I:Integer;
begin
for I:=1 to 5 Do
begin
Sub:=TSub.Create(Self);
Sub.Parent:=Self;
Sub.Align:=alClient;
Sub.Caption:='Form ' + IntToStr(I);
Sub.Show;
end;
end;
end.
/////////////////////////////////////////////////////////////////////
unit SubF;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TSub = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Sub: TSub;
implementation
{$R *.DFM}
procedure TSub.Button1Click(Sender: TObject);
begin
ShowMessage(Self.Caption);
end;
end.
关闭或 打开几个窗体后,怎么判断当前的最上面的可视子窗体?