請高手幫忙,代碼怎么實作
Form1表單型別MDI
.h
private: // User declarations
void __fastcall CreateMDIChild(const String Name);
.cpp
void __fastcall TForm1::ToolButton3Click(TObject *Sender)
{
CreateMDIChild("ToolButton3");
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CreateMDIChild(String Name)
{
if(Name=="ToolButton3")
{
TForm2 *Form2;
Form2=new TForm2(Application);
Form1->Caption=Form1->ActiveMDIChild->Name;
if(Form1->Caption.Length()<6 )
{
Form2->Width=Form1->Width*0.95;
Form2->Height=Form1->Height*0.80;
}
else
{
FLOAT WH=StrToFloat(Form1->Caption.SubString(Form1->Caption.Length(),1))+1;
Form2->Width=Form1->Width/WH;
Form2->Height=Form1->Height/WH;
}
}
}
//---------------------------------------------------------------------------
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/77356.html
標籤:基礎類
