Designer.CS file is associate with the controls / forms to keep the properties and values that are serialized in the designer, For instance you added a button to the form and change its DockStyle,
In this case the designer will serialize the DockStyle when the value is changed and is not the default value of the control.
This designer file can be removed by moving the Initialize component method to the corresponding form.
Designer.resx : For instance you create a control and change its Image / Icon, this information will be serialized as a stream and kept in resx files.
Not all the controls requires a designer / resources, for instance a simple gradient panel could be the following one!.
public class GradientPanel : Panel
{
public Color GradientBegin { get; set; }
public Color GradientEnd { get; set; }
public GradientPanel()
: base()
{
this.GradientBegin = Color.Yellow;
this.GradientEnd = Color.Green;
}
protected override void OnPaintBackground(PaintEventArgs e)
{
using (LinearGradientBrush brush = new
LinearGradientBrush(this.ClientRectangle,
this.GradientBegin,
this.GradientEnd,
LinearGradientMode.Horizontal))
{
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
}
}
Hope this helps!
Vallarasu S.