13,825
社区成员
发帖
与我相关
我的任务
分享
class TFormControl:public TCustomForm
{
public:
__fastcall TFormControl(TComponent* Owner);
};
__fastcall TFormControl::TFormControl(TComponent* Owner):TCustomForm(Owner)
{
this->Left = 20;
this->Top = 20;
this->Width = 200;
this->Height = 400;
}
TFormControl *Form2 = new TFormControl(NULL); //提示TFormControl 类资源找不到
class TFormControl:public TCustomForm
{
public:
__fastcall TFormControl(TComponent* Owner);
__fastcall TFormControl(System::Classes::TComponent* AOwner, int Dummy);
};
__fastcall TFormControl::TFormControl(TComponent* Owner):TCustomForm(Owner)
{
this->Left = 20;
this->Top = 20;
this->Width = 200;
this->Height = 400;
}
__fastcall TFormControl::TFormControl(TComponent* AOwner, int Dummy):TCustomForm(Owner, Dummy)
{
this->Left = 20;
this->Top = 20;
this->Width = 200;
this->Height = 400;
}
然后这样创建:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TFormControl *Form2 = new TFormControl(this, 0);
Form2->Show();
}