help to design my mc++ project

  • Thread starter Thread starter finleeds
  • Start date Start date
F

finleeds

Hi all

here is my problem :

my main form contains lot of panels and I do not want to have all the
code in the mainform.cpp.

so I tought the best way is to move all the controls I ve got for every
panels into several custom controls.

but is it the best way to do ? can I avoid multiple dlls (one per
custom controls) ?

could you advice me on my issue or show me some articles/samples

thanks in advance

ben
 
Did you know that you can place a form onto a panel on another form?
Here's how (trying to recall it from memory):

MyForm* f = new MyForm;
// for C++/CLI, replace * with ^, new with gcnew
f->TopLevel = false;
// this is a must for placement on a panel on another form
f->Dock = System::Windows::Forms::DockStyle::Fill;
// fill its parent, the panel
this->panel1->Controls->Add(f);
// place "f" on a panel on the current form
f->Show();
// I think you need this too

So you can break a large form into several smaller sub-forms, and put
them together in the application's main window. It's often better than
building huge monster forms, especially if you can reduce or completely
eliminate inter-dependencies between the individual sub-forms. In case
the sub form's caption shows up, I know you can disable that easily. I
don't remember all the details off the top of my head.

If the sub-form is something that you plan to reuse in many projects,
you can try to create a control library for that. Otherwise it's not
necessary for the concept to work.

Tom
 
Back
Top