delphi 提示variable "form2"might not have been initialized.一运行就提示错误并显示progect1program Project1;usesForms,Unit1 in 'Unit1.pas' {Form1};{$R *.res}beginApplication.Initialize;Application.CreateForm(TForm1,Form1);Application.Run;e

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 07:46:37
delphi 提示variable
xAkAǿPnH@`6yIFwgH,PM-j%(4=(1 evɯPiEeoblȰ7`ԲU]dVK]Iq&SaIɉy^z­AYfYP Q>wPd#ӣ<و2+k)ߴ٬L%s|#?$J?O0/`g@nL 䂊pp0٥f10>)[wYyQ NBr`g\b:*Է/I0Fᖡ AV 3KԺv"WZb 3CN6ǸJ8&EsJs3M(| S9[EU^f_f:VG*z,xGdНE^+Q3loV3T7ÙzQe6H|vzяUB(/OD&

delphi 提示variable "form2"might not have been initialized.一运行就提示错误并显示progect1program Project1;usesForms,Unit1 in 'Unit1.pas' {Form1};{$R *.res}beginApplication.Initialize;Application.CreateForm(TForm1,Form1);Application.Run;e
delphi 提示variable "form2"might not have been initialized.
一运行就提示错误并显示progect1
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1,Form1);
Application.Run;
end.
在主程序中引用了form2
implementation
uses midaslib,Unit2,Unit3,unit4 ;
.
.
rocedure TForm1.Button1Click(Sender:TObject);
var i,y1,m1,y2,m2:integer;
form2:Tform2;
begin
try
form2:=Tform2.Create(self);
form2.ShowModal ;
.
.
form2.free

delphi 提示variable "form2"might not have been initialized.一运行就提示错误并显示progect1program Project1;usesForms,Unit1 in 'Unit1.pas' {Form1};{$R *.res}beginApplication.Initialize;Application.CreateForm(TForm1,Form1);Application.Run;e
DELPHI主菜单:prooject>Options>forms页,在auto-create forms列表框中,将form2移动到Available forms列表框中,就不会出现那提示了.