Load form in a tab panel?

  • Thread starter Thread starter Ali M
  • Start date Start date
A

Ali M

Hi there,

Is there a way to display a form onto a tab panel dynamically? I am
trying to supply a form from within a referenced component to the main
application dynamically at runtime. I want the same tab panel to be
able to display any form residing within or outside its assembly. Is
there a way to do this? Thanks in advance!

AM
 
Ali M said:
Is there a way to display a form onto a tab panel dynamically? I am
trying to supply a form from within a referenced component to the main
application dynamically at runtime. I want the same tab panel to be
able to display any form residing within or outside its assembly.

Maybe creating a usercontrol instead of the form is a better approach. If
you need to use forms for some reason, set the form instance's 'TopLevel'
property to 'False' and add it to the container's 'Controls' collection.
 
Thanks for the speedy reply. I tried your suggestion (using the form)
and it works ok. I need to use a form because they need to work
outside of the application too, i.e. they need to be exposed as Forms!
Thanks again...
 
Ali M said:
Thanks for the speedy reply. I tried your suggestion (using the form)
and it works ok. I need to use a form because they need to work
outside of the application too, i.e. they need to be exposed as Forms!

You could simply place the usercontrols on forms if you want to expose them
as forms too.
 
Back
Top