There are a few ways to start creating a new custom control in VS? Which one should I use? As in:
Right click project -> Add ->
1. User Control, or
2. Component, or
3. Custom Control, or?
I use #1 and get a partial class similar to:
namespace MyControls
{
partial class NewControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose ( bool disposing )
{
if ( disposing && ( components != null ) )
{
components.Dispose ( );
}
base.Dispose ( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent ( )
{
components = new System.ComponentModel.Container ( );
//this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
}
#endregion
}
Why do I need this class? Is it only useful for composite controls where you need to use the designer?
EDIT: I know about the partial keyword and classes, but I don't know why I need this particular class for my custom control. It doesn't seem to make a difference.