The fact is that the code for the GUI itself should not be changed manually, because any changes inside the designer can then overwrite or delete all your changes manually.
The code file that you really see is the same class as the other code behind the file, but the class is divided into two using the keyword partial. This keyword was made for this purpose, so that automatically generated code and manually written code can be placed in two different files.
source
share