Why does Visual Studio / WinForms create partial classes / files?

As the question says, what is the reason for this? I understand that this helps to separate the visual code (design) from the background code (which is actually happening), but it makes it more frustrating for a new person to work with Visual Studio.

For example, you are creating a new application with one form. Then you get 3 files and a design. Form1.cs, where the main programming is Form1.Designer.cs, where most of your visual presentation takes place, and another Program.cs, which serves as the entry point.

Why is this so? And is it possible to create a complete working form with all the code in one file, what would it look like? Or does VS indicate that all three files should be separate?

The main reason I am asking this is because I would like to go to the basics and see if it is possible to make a simple 100-200 line program in just a TXT file, and what exactly I would like to look for.

+3


source to share





All Articles