GUI Designer and code view

I don’t understand why in the code view the form code is displayed instead of the Form.designer file, which is the actual file containing the GUI code. How could they say then that you can see the graphical interface in the designer or in the form of code?

+3
source share
2 answers

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.

+7
source

"Code view" means: the code of your class (or module), not necessarily the GUI code for this class.

0
source

Source: https://habr.com/ru/post/1789452/


All Articles