how to create another form.cs file in visual studio winforms
- User
how to create another form.cs file in visual studio winforms
- Assistant
To create another form (
.cs) file in a Visual Studio WinForms project, follow these steps:Steps to Add a New Form in a WinForms Project
-
Open your project in Visual Studio.
-
In the Solution Explorer, right-click on your project (not the solution).
For example, if your project is namedMyWinFormsApp, right-click on that. -
Go to Add → Windows Form...
-
In the dialog that appears, type a name for your new form, for example
Form2.cs. -
Click Add.
Visual Studio will create a new Windows Form with a
.csfile, a file, and a file associated with the form by default, just like your main form. -