像c#这种语言
 
 


现在 可以看到有  3个cs源文件
Form1.cs
Form1.Designer.cs
Program.cs
前两个文件是一个类:::::前面的两个源文件用到了partial关键词
而Program.cs这个类 有Main方法!!!是程序的入口!

而 Form1.Designer.cs这个类是第一个类的  界面初始化,也就是说在是设计视图下设置的代码,自动在Form1.Designer.cs这个类中,而我无须去修改这个类
只需修改Form1.cs这个类!
这也是在界面设计的时候特有的!
 
 
  
  1. namespace WinFormHello  
  2. {  
  3.     partial class Form1  
  4.     {  
  5.         /// <summary>  
  6.         /// 必需的设计器变量。  
  7.         /// </summary>  
  8.         private System.ComponentModel.IContainer components = null;  
  9.  
  10.         /// <summary>  
  11.         /// 清理所有正在使用的资源。  
  12.         /// </summary>  
  13.         /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>  
  14.         protected override void Dispose(bool disposing)  
  15.         {  
  16.             if (disposing && (components != null))  
  17.             {  
  18.                 components.Dispose();  
  19.             }  
  20.             base.Dispose(disposing);  
  21.         }  
  22.  
  23.         #region Windows 窗体设计器生成的代码  
  24.  
  25.         /// <summary>  
  26.         /// 设计器支持所需的方法 - 不要  
  27.         /// 使用代码编辑器修改此方法的内容。  
  28.         /// </summary>  
  29.         private void InitializeComponent()  
  30.         {  
  31.             this.label1 = new System.Windows.Forms.Label();  
  32.             this.userName = new System.Windows.Forms.TextBox();  
  33.             this.OK = new System.Windows.Forms.Button();  
  34.             this.SuspendLayout();  
  35.             //   
  36.             // label1  
  37.             //   
  38.             this.label1.AutoSize = true;  
  39.             this.label1.Location = new System.Drawing.Point(33, 42);  
  40.             this.label1.Name = "label1";  
  41.             this.label1.Size = new System.Drawing.Size(95, 12);  
  42.             this.label1.TabIndex = 0;  
  43.             this.label1.Text = "Enter Your Name";  
  44.             //   
  45.             // userName  
  46.             //   
  47.             this.userName.Location = new System.Drawing.Point(35, 127);  
  48.             this.userName.Name = "userName";  
  49.             this.userName.Size = new System.Drawing.Size(100, 21);  
  50.             this.userName.TabIndex = 1;  
  51.             this.userName.Text = "here";  
  52.             //   
  53.             // OK  
  54.             //   
  55.             this.OK.Location = new System.Drawing.Point(177, 127);  
  56.             this.OK.Name = "OK";  
  57.             this.OK.Size = new System.Drawing.Size(75, 23);  
  58.             this.OK.TabIndex = 2;  
  59.             this.OK.Text = "OK";  
  60.             this.OK.UseVisualStyleBackColor = true;  
  61.             this.OK.Click += new System.EventHandler(this.OK_Click);  
  62.             //   
  63.             // Form1  
  64.             //   
  65.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);  
  66.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;  
  67.             this.ClientSize = new System.Drawing.Size(273, 183);  
  68.             this.Controls.Add(this.OK);  
  69.             this.Controls.Add(this.userName);  
  70.             this.Controls.Add(this.label1);  
  71.             this.Name = "Form1";  
  72.             this.Text = "Form1";  
  73.             this.ResumeLayout(false);  
  74.             this.PerformLayout();  
  75.  
  76.         }  
  77.  
  78.         #endregion  
  79.  
  80.         private System.Windows.Forms.Label label1;  
  81.         private System.Windows.Forms.TextBox userName;  
  82.         private System.Windows.Forms.Button OK;  
  83.     }  
  84. }  
  85.