Is it possible to embed a windows form within another windows form?
I have created a windows form in Visual Studio along with all its associated behaviour.
I
let's say you have 2 projects win1 and win2. both are winform projects. you look for embeding win2 in win1.
solution:
open the win2 project and change the output type to "Class Library" (in Application tab)
open the project win1, and add the win2 dll project as a ref in win1 project go in the win1 code, and put this :
win2.Form1 formI = new win2.Form1();
formI.TopLevel = false;
formI.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
formI.Size = this.Size;
formI.BringToFront();
formI.Visible = true;
this.Controls.Add(formI);