(Why/How) should I use .designer files?
.net, c#, windows-forms-designer
Solution
I can't remember the exact dates but I know that up to a certain point Visual Studio did not use a separate .designer class and contained all of the designer and logic in the same class contained within a region. The fact that that is no longer the case should tell you that it was widely considered inferior to separating the code files.
Since then the Visual Studio designer makes use of the `partial` modifier to separate the UI logic and UI design. When you call `InitializeComponent` you basically invoke all of the code, generated by the designer to create the UI.
I am sure the designer creates two separate files to abstract the generated code from the developer as it shouldn't be amended manually. As you will not be using the designer then this serves little advantage to you, which is something to consider.
I think choosing not to use the awesome designer tools that assist in making .NET a RAD environment is illogical and would not fly well with many other coders so I would say - just do what you like. If you find surrounding your designer code in a region in a single class is cleaner and more legible than using a separate designer file then, so be it.
Problem
I've never liked the Visual Studio `[Design]` tab when creating my forms, which is why I always create my forms programmatically from a scratch and I only use one `.cs` file, such as `Form1.cs`. Just today I noticed that creating a new Form with the `[Design]` tab also creates a file called `*.Designer.cs`, which handles all the design related stuff. Since I'm doing my forms manually, should I still use `*.Designer.cs` file? If so, when, how and why should I use it? What is the `*.Designer.cs` file meant to do, is it only to separate VS auto-generated code from the user code, or does it have a deeper meaning? Here's an example on how I create my Forms: ``` class MyForm : Form { TextBox file; Button open, close; MyForm() { InitControls(); } void InitControls() { file = new TextBox(); file.Location = Point(...); open = new TextBox(); open.Text = "Open File"; ... } } ``` Should I separate my `InitControls` method and variable declarations to `.Designer.cs` file?