在设计环境中怎样通过C#执行代码修改winform的.Designer.cs文件的内容而添加控件?
谢谢

解决方案 »

  1.   

    通过运行修改desiger.cs文件向其Form中添加控件
    如通过添加
               this.button1.Location = new System.Drawing.Point(73, 53);
              this.button1.Name = "button1";
              this.button1.Size = new System.Drawing.Size(75, 23);
              this.button1.TabIndex = 0;
              this.button1.Text = "button1";
              this.button1.UseVisualStyleBackColor = true;
              this.button1 = new System.Windows.Forms.Button();          private System.Windows.Forms.Button button1;在Form上添加一个button