hello,
i have a windows application which is fully self sufficient..it has a form with a few controls and the usual event handling...
i made another windows application with a tabcontrol with a tabpage inside it..i want to load the form of first application inside the tabpage of second application..
so that it feels like the first application is fully inside the second one..i should be able to load and unload instances of the first form..is there any way i can do it ?
both shud not be dependent on each other..so if user wants he can load the first form without help of second..
please point me in the right direction..
project is in C# ..
Thank You !
Loading
lazy coderPosted Sep 7, 2007, 6:12 AM
Scott LyslePosted Sep 7, 2007, 2:26 AM
The easiest way to do that would be to convert the form to a user control and add the user control to the tab in which you want the form to appear; else that or rebuild your application as an MDI application where you can open both forms up within the MDI parent's workspace.
The user control conversion should work if the form does not contain anything that will foul up a user control (like a menustrip control). You cannot add a top level control (a form) to control so you will have to go the route of the user control or switch to an MDI application.
To convert the form to a user control, open the code view on the Form and change one line; where the form is going to show that it inherits from Form, change it to inherit from User Control:
public
partial class Form2 : UserControl