When I create an empty project in Visual Studio there is a Form1.cs which contains the Subfiles Form1.designer.cs and Form1.resx.
When I download some sample code e.g. from CodeProject very often the Designer.cs isn´t there and the code of the designer is included in the Form1.cs. I tried to make it like this, but I just get an error of Visual Studio when I want to view the Form1.cs[Design] tab.
How can I achieve that the designer code is in the Form1.cs and not in a seperate file?
Addition: Visual Studio creates my solution file in the project folder and the project files in the subfolders. In the sample codes often all files are in the same directory.
How may I achieve that?
Addition: Here is a link to a sample Main.cs where the designer code is integrated to the Main.cs
Just cut and paste the code from Form1.Designer.cs to Form1.cs
Both Form1.Designer.cs and Form1.cs implements the class Form1. They use the keyword partial
to split the declaration in two files. The reason is to separate the designer generated code from the code you write manually.