How does .NET create and execute its Windows buttons, etc.?

I was interested from the first day when I started reading how the .NET Framework works?

At first it is very good to have an IDE, for example Visual Studio. For example, when I click and drop text fields, buttons, set their properties, etc., Everything works fine. But in the case of Java, in most cases, we, as programmers, write coding to develop Frame (window). But in the case of .NET, Visual Studio simplifies the work, but how is the work created without creating a single line of code, all Windows, buttons, etc.?

And if I change the name of the button in the design area of ​​the form, where will it be stored, and more importantly, how will it be displayed during the execution of our program? This is magic? Or is there a long process under the hood?

+3
source share
2 answers

There is no magic behind it. Visual Form Designer in Visual Studio generates C # code for you. Just copy the file Form1.designer.cs.

+7
source

The code in your .designer.cs is generated by serialization (objects -> code, code -> objects). Take a look at the CodeDomSerializer class if you want to better understand what is happening under the hood (using Reflector you can check the ControlCodeDomSerializer in System.Design.dll). And, of course, you can create your own serializer for custom controls and components.

0
source

All Articles