Alex Gordon
Alex Gordon

Reputation: 60871

Purpose of form1.designer.cs and form1.resx

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

Can someone please explain them to me?

Upvotes: 6

Views: 5412

Answers (3)

sblom
sblom

Reputation: 27363

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.

Upvotes: 9

lightw8
lightw8

Reputation: 3282

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.

Upvotes: 4

Danny Varod
Danny Varod

Reputation: 18118

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

Upvotes: 4

Related Questions