How do I add another form into my win form application?
To add and design a new form at design time, right click the target project node in the Solution Explorer and select AddàAdd Windows Form… This will add a new form; design it by placing controls and setting necessary properties.
To show the new form at run time, instantiate the new form and call its Show() or ShowDialog() method.
Let we name the new form as ‘MySecondForm’, then on the click event of the button of our first (startup) form, we can write the following code:
C# Version
MySecondForm frm2 = new MySecondForm();
frm2.Show(); // will present the non-modal form
// frm2.ShowDialog(); // will present the modal form
VB.NET Version
Dim frm2 As New MySecondForm()
frm2.Show() ' will present the non-modal form
' frm2.ShowDialog() 'will present the modal form
Index