I am looking over someone Else’s code and noticed that some of the user control items have Class.Designer.cs and Class.resx files while others only have the .resx file. Is there a way I can add a .cs file to the controls with only a .resx file?
Why/how would this occur?
Is there any difference between the two? It looks like designer code is in the Designer.cs file while the UC with only has .rexs has all the code in a single .cs file.
Thanks!
Some people automatically delete the Class.Designer.cs file when creating User Controls and Forms. If they do this, then the code to manage the placement of controls on the Form and such are not longer separated into a partial class, but are instead included into the code behind of the Class.cs file.
For example here is Form 1.designer.cs.
If I create another form, but delete the designer file, you will see this sort of code will go into the Form1.cs code file instead:
This doesn’t cause any harm, however having the code that deals with the form controls in a different file keeps your code looking leaner and cleaner and is therefore easier to navigate and manage.