日期:2014-05-19  浏览次数:20764 次

为什么新建立项目有两个CS文件,有什么作用的?
新建立一个window应用程序项目,上面有
Form1.cs   和   Form1.Designer.cs
Form1.cs:
using   System;
using   System.Collections.Generic;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Text;
using   System.Windows.Forms;

namespace   _7_04
{
        public   partial   class   Form1   :   Form
        {
                public   Form1()
                {
                        InitializeComponent();
                }
        }
}
---------------------------
Form1.Designer.cs:
namespace   _7_04
{
        partial   class   Form1
        {
                ///   <summary>
                ///   必需的设计器变量。
                ///   </summary>
                private   System.ComponentModel.IContainer   components   =   null;

                ///   <summary>
                ///   清理所有正在使用的资源。
                ///   </summary>
                ///   <param   name= "disposing "> 如果应释放托管资源,为   true;否则为   false。 </param>
                protected   override   void   Dispose(bool   disposing)
                {
                        if   (disposing   &&   (components   !=   null))
                        {
                                components.Dispose();
                        }
                        base.Dispose(disposing);
                }

                #region   Windows   窗体设计器生成的代码

                ///   <summary>
                ///   设计器支持所需的方法   -   不要
                ///   使用代码编辑器修改此方法的内容。
                ///   </summary>
                private   void   InitializeComponent()
                {
                        this.components   =   new &nb