Follow the below steps to know "Closing the old form and then opening a new form".
Step 1
Create new windows application. Right click on the Form1.cs in the solution explorer. Then, a popup menu will appear as shown in the below figure.
Step 2
Select the Rename, and give the appropriate name for the form.
Now, Design the form as shown in the below figure.
Step 3
Next, Right click on the WindowsFormsApplication in the solution explorer.
Goto Add->New Item as shown in the below figure.
Step 4
Then, a window will appear as shown in the below figure.
Step 5
Select the Windows Form, and give the name in the Name field as shown in the below figure.
Step 6
Then, a new form will appear in the solution explorer as shown in the below figure.
Step 7
Design the second form as shown in the below figure.
Step 8
Now, Double click on the button in the FirstForm. Then the click event will be generated. Write the following code under the button click event of FirstForm.
[csharp]
private void btnWelcome_Click(object sender, EventArgs e)
{
this.Hide();//Hides the First Form
SecondForm obj = new SecondForm();// Creates an object for the second form
obj.Show();// Displays the SecondForm
}
[/csharp]
Step 9
Run the application by pressing button f5 in the keyboard.
The following window will appear.
Step 10
Click on the button shown in the above figure. Then, the First Form will be closed and a new form called Second Form will be open as shown in the below figure.