lojol
lojol

Reputation: 471

GUI Designer and Code view

I do not understand why code view displays the code of Form instead of Form.designer file, which is the actual file containing the GUI code. How could they say then that you can see GUI in designer or code view?

Upvotes: 3

Views: 529

Answers (2)

Peladao
Peladao

Reputation: 4090

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

Upvotes: 0

Øyvind Bråthen
Øyvind Bråthen

Reputation: 60714

The point is that the code behind for the GUI itself should not be altered manually, because any changes inside the designer can then overwrite or remove all your manual changes.

The code file you actually get to see is the same class as the other code behind file, but the class is split into two by the use of the partial keyword. This keyword was actually made for this purpose, so that auto generated code, and manually written code can be put into two different files.

Upvotes: 7

Related Questions