I am writing a component and want to change the base type to a TForm however at run time I get the error "Resource TMyComp not found". I guess that this is because there is no dfm but I am not sure what to do about it.
Thanks
unit Unit65;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TMyComp = class(TForm);
TForm65 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
Mc: TMyComp;
{ Private declarations }
public
{ Public declarations }
end;
var
Form65: TForm65;
implementation
{$R *.dfm}
procedure TForm65.Button1Click(Sender: TObject);
begin
Mc := TMyComp.Create(Self);
Mc.Parent := nil;
Mc.ShowModal;
end;
end.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…