K
kisssun
Unregistered / Unconfirmed
GUEST, unregistred user!
错误产生在MyForm:=TMyForm1.Create(Application);这行.
错误为"Resource TMyForm1 not found"!!!
不胜感激!
代码如下:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CheckLst, Buttons;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TMyForm1 = class(TForm)
private
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Function MyInteger:Integer;
var
MyForm:TMyForm1;
begin
MyForm:=TMyForm1.Create(Application);
try
MyForm.BorderStyle := bsDialog;
MyForm.Caption :='XXX';
MyForm.Position := poScreenCenter;
MyForm.Width :=310;
MyForm.Height :=380;
Result:=1;
MyForm.ShowModal ;
finally
MyForm.free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var xxx:integer;
begin
xxx:=MyInteger;
showmessage(inttostr(xxx));
end;
end.
错误为"Resource TMyForm1 not found"!!!
不胜感激!
代码如下:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CheckLst, Buttons;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TMyForm1 = class(TForm)
private
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Function MyInteger:Integer;
var
MyForm:TMyForm1;
begin
MyForm:=TMyForm1.Create(Application);
try
MyForm.BorderStyle := bsDialog;
MyForm.Caption :='XXX';
MyForm.Position := poScreenCenter;
MyForm.Width :=310;
MyForm.Height :=380;
Result:=1;
MyForm.ShowModal ;
finally
MyForm.free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var xxx:integer;
begin
xxx:=MyInteger;
showmessage(inttostr(xxx));
end;
end.