Visual Studio创建类似下面的代码:自定义Winforms是否需要控制自动生成的设计器文件?
namespace MyCustomControls
{
partial class MyCustomControl
{
/// <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 ();
}
#endregion
}
}
谢谢Marc。你说过“在某些方面,这使得更容易实现Dispose()等。”你的意思是杀死该文件?我看到他们已经在那里处理方法,所以认为可能需要该文件来正确处理您的控制。 – 2009-11-18 23:04:47