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