delphi form2 要使用form1中创建的文件,怎么使用,代码应该怎么写,具体些。谢谢
1个回答
展开全部
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses <<<=====在这里加
unit1; <<<=====在这里加
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
form1.Button1.Click; <<===使用方法
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses <<<=====在这里加
unit1; <<<=====在这里加
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
form1.Button1.Click; <<===使用方法
end;
end.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询