Purpose of form1.designer.cs and form1.resx

I have been doing vb.net for a long time and don’t understand the purpose of these two files:

  • form1.designer.cs
  • form1.resx

Can someone please explain them to me?

+6
c # winforms
source share
3 answers

form1.designer.cs is an automatically generated file corresponding to form1.cs. The idea is that a Visual Studio form developer can put his automatically generated code into form1.designer.cs without worrying about messing up any changes you might make.

form1.resx is most often used to store strings that you want to translate into different languages ​​so that you do not transcode them into your application.

+9
source share

..designer.cs contains controls and layout, .resx contains materials such as resources and language dictionaries.

+4
source share

form1.designer.cs is a file that is automatically generated by the IDE (for example, Visual Studio). It contains all the initialization elements associated with WinForms, separate from the "clean" code that accesses form1.cs.

Note that form1.designer.cs is combined with the code from form1.cs by the compiler because the classes are listed as partial and therefore are two parts of the same class definition.

+4
source share

All Articles