Adding new Windows Forms in C# Windows Application



Adding C# Windows Forms

In our previous .net post we already learnt to create new windows form application project and got knowledge about .net framework.

Today, we will learn in this c#.net post, how to create new windows form in windows application project. After creating new windows application the right side you can see the solution explorer, which include whole project. As shows in figure right click on project in solution explorer, the menu have two options for create windows form, first one is New Item and second one is Windows Form.

Create new windows form

Right click on Project –> Add –> New Item –> Windows Form

meeraacademy.com
Adding new windows form in windows application

As shown in above figure right click on project menu and select New Item or Windows Form to create new windows form in application.

Here, we have to select Windows Form and assign appropriate name for windows form and click on Add button to create a new windows form. By default windows form name will be Form1.cs and Form2.cs….

meeraacademy.com
Adding new windows form in windows application

Now, Here we have successfully created new windows form with name “Form2.cs”. Each form has a two part one is design part and other is coding part. In below screen we are at on design part of windows form.

meeraacademy.com
Adding new windows form in windows application

In below screen shows code part of form. when right click on Form the menu has two options a View Code and View Designer. we can use F7 key shortcut to open code view of form and press Shift + F7 for open design view of windows form.

View Code :: F7 key
View Designer :: Shift + F7 key

meeraacademy.com
Adding new windows form in windows application

We hope that this c#.net post helped you to understand about how to create new windows form.


Next, c# windows application tutorial we will understand about how to run windows application.


 

Leave a Reply

Your email address will not be published. Required fields are marked *