55143681 Posted February 16, 2019 Share Posted February 16, 2019 I have create some forms,all the form's parent is set to UnimContainerPanel1,I have some buttons to switch and display the different forms, but they can only be show at the first time created,when a new form is created, the old can never show again,how to show the form first created? TUnimFormMain01 *mainForm01=(TUnimFormMain01 *)UnimContainerPanel1->FindChildControl("UnimFormMain01"); if(mainForm01!=NULL) { ShowMessage(mainForm01->Caption); mainForm01->BringToFront(); } else { mainForm01=new TUnimFormMain01(UniApplication); mainForm01->Parent=UnimContainerPanel1; } Link to comment Share on other sites More sharing options...
55143681 Posted February 16, 2019 Author Share Posted February 16, 2019 6 minutes ago, 55143681 said: I have create some forms,all the form's parent is set to UnimContainerPanel1,I have some buttons to switch and display the different forms, but they can only be show at the first time created,when a new form is created, the old can never show again,how to show the form first created? TUnimFormMain01 *mainForm01=(TUnimFormMain01 *)UnimContainerPanel1->FindChildControl("UnimFormMain01"); if(mainForm01!=NULL) { ShowMessage(mainForm01->Caption); mainForm01->BringToFront(); } else { mainForm01=new TUnimFormMain01(UniApplication); mainForm01->Parent=UnimContainerPanel1; } mainForm01 and mainForm02 all are UnimContainerPanel1's child,I first create mainform01,and displayed normal,then create mainform02 ,and displayed normal, then how to display the first created form (mainform01 ) again? void __fastcall TMainmForm::UnimSegmentedButton1Click(TUnimButtonItem *Sender) { if(Sender->ButtonId==0) { TUnimFormMain01 *mainForm01=(TUnimFormMain01 *)UnimContainerPanel1->FindChildControl("UnimFormMain01"); if(mainForm01!=NULL) { //ShowMessage(mainForm01->Caption); mainForm01->BringToFront(); } else { mainForm01=new TUnimFormMain01(UniApplication); mainForm01->Parent=UnimContainerPanel1; } } if(Sender->ButtonId==1) { TUnimFormMain02 *mainForm02=(TUnimFormMain02 *)UnimContainerPanel1->FindChildControl("UnimFormMain02"); if(mainForm02!=NULL) { //ShowMessage(mainForm02->Caption); mainForm02->BringToFront(); } else { mainForm02=new TUnimFormMain02(UniApplication); mainForm02->Parent=UnimContainerPanel1; } } if(Sender->ButtonId==2) { } if(Sender->ButtonId==3) { } } //--------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now