Another less elegant but quick hack approach is to simply not add a panel to the parent form until runtime. At the same time, the designer has no idea where the panel belongs before compilation, and it will not be displayed.
For example, find the block of code in which you add controls to the parent form:
//this->Controls->Add(this->panel_X); this->Controls->Add(this->tabControl); this->Controls->Add(this->menuStrip_topMenu);
Comment or delete an instruction, then find the handle to the event that occurs when the form loads:
this->Load += gcnew System::EventHandler(this, &MainForm::MainForm_Load);
Then, in the event handler definition, add the control to the form:
System::Void MainForm_Load(System::Object^ sender, System::EventArgs^ e) { ... ... this->Controls->Add(this->panel_X); }
I did not experience any unwanted side effects while doing this, but if someone has a good reason, I would not want to hear it.
source share