地方性商业银行:路过的不要错过:delphi编程问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 20:02:55
请高手指教:
我新建了一个窗体1,在form1里新建一个button1按钮,编辑他的代码为form2.show;,然后新建form2 测试能否show出,可是就是show不出,讲什么undeclared indentifier "form2"
下面是代码:----------
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, 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

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.show;
end;

end.

在type
后面加上定义:
TForm2 = class(TForm);