Y
yzykjh
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, UMyVCL;
type
TForm1 = class(TMyForm) //没有出现"Resource TMyForm not found"提示
Button1: TButton;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var bl: TMyForm;
begin
bl:=TMyForm.Create(Self); //提示"Resource TMyForm not found"
bl.Showmodal; //请问如果解决?
freeandnil(bl);
end;
end.
--------------
unit UMyVCL;
interface
uses Windows, Forms, Classes, Dialogs;
type
TMyForm = Class(TForm)
private
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{ TMyForm }
constructor TMyForm.Create(AOwner: TComponent);
begin
inherited;
Font.Name:='宋体';
Font.Size:=9;
FormStyle:=fsStayOnTop;
Position:=poMainFormCenter;
ShowHint:=True;
...
end;
destructor TMyForm.Destroy;
begin
inherited;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, UMyVCL;
type
TForm1 = class(TMyForm) //没有出现"Resource TMyForm not found"提示
Button1: TButton;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var bl: TMyForm;
begin
bl:=TMyForm.Create(Self); //提示"Resource TMyForm not found"
bl.Showmodal; //请问如果解决?
freeandnil(bl);
end;
end.
--------------
unit UMyVCL;
interface
uses Windows, Forms, Classes, Dialogs;
type
TMyForm = Class(TForm)
private
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
implementation
{ TMyForm }
constructor TMyForm.Create(AOwner: TComponent);
begin
inherited;
Font.Name:='宋体';
Font.Size:=9;
FormStyle:=fsStayOnTop;
Position:=poMainFormCenter;
ShowHint:=True;
...
end;
destructor TMyForm.Destroy;
begin
inherited;
end;
end.