Im am not sure about how the 2 forms interact but the following code will show you two forms.
There are other ways to do depending on the application business.
Form1.cs
********
public class Form1 : System.Windows.Forms.Form // main form created with Designer
{
private Form2 frm2 ; // add it after finishing with Designer
// other members
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
frm2= new Form2(); // add it after finishing with Designer
frm2.Show(); // add it after finishing with Designer
}
// other members
static void Main()
{
Application.Run(new Form1());
}
}
Form2.cs
********
public class Form2 : System.Windows.Forms.Form // added with Designer
{
// members of this form
// no reference to the Form1
}
With that you have the both Form2 and Form1 and you can edit independently but when you close Form1 , Form2 will be also closed.
-obislavu-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.