Purpose of form1.designer.cs and form1.resx

前端 未结 3 707
没有蜡笔的小新
没有蜡笔的小新 2020-12-19 07:33

I\'ve been doing vb.net for a while and I don\'t understand the purpose of these two files:

  • form1.designer.cs
  • form1.resx

Can someone pl

相关标签:
3条回答
  • 2020-12-19 08:09

    form1.designer.cs is a file that is auto-generated by the IDE (e.g. Visual Studio). It keeps all the WinForms related initialization elements separate from the "clean" code-behind form1.cs.

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

    0 讨论(0)
  • 2020-12-19 08:13

    form1.designer.cs is an auto-generated file that corresponds to form1.cs. The idea is that the Visual Studio form designer can put its auto-generated code in form1.designer.cs without having to worry about messing up any changes that you may have made.

    form1.resx is most commonly used for storing strings that you want to translate into different languages so you don't hardcode them into your app.

    0 讨论(0)
  • 2020-12-19 08:21

    The .designer.cs contains the controls and layout of the form, the .resx contains stuff like resources and language dictionaries.

    0 讨论(0)
提交回复
热议问题