窗体设计器:工具箱、拖放、属性与事件窗口,读写 VS 格式的 Designer.cs

- Designer.cs 在浏览器端解析为语句列表,未改动的语句保留原文:
  教材 25 个参考窗体和全部示例读入再写出逐字节不变
- 编辑操作:添加 / 删除 / 移动 / 改名控件、属性、事件、列表项;
  布局语句增删规则与 VS 一致(对全部现有文件执行无变化)
- 双击控件或事件:绑定事件并在窗体代码末尾插入处理方法,跳到代码
- 预览复用运行时的 ControlView,设计时与运行时外观一致
- 修正:窗体属性 this.ClientSize = new Size(...) 被误认成创建控件;
  示例 Designer.cs 的块头注释改为 VS 的 "// " 格式
- 测试:73 个(读写往返、布局规则、编辑操作、插入事件处理方法)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-22 11:11:48 +08:00
1 parent 03e80ce2e2
commit ea5a25af06
20 files changed
+2767 -132

No files matched your search

+16 -16
View File
@@ -37,17 +37,17 @@ namespace ZigBee路灯
this.lbl_Lamp = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
//
// lamp1
//
//
this.lamp1.BackColor = System.Drawing.Color.White;
this.lamp1.Location = new System.Drawing.Point(29, 28);
this.lamp1.Name = "lamp1";
this.lamp1.Size = new System.Drawing.Size(105, 185);
this.lamp1.TabIndex = 0;
//
//
// rb_Open
//
//
this.rb_Open.AutoSize = true;
this.rb_Open.Location = new System.Drawing.Point(29, 222);
this.rb_Open.Name = "rb_Open";
@@ -56,9 +56,9 @@ namespace ZigBee路灯
this.rb_Open.Text = "开";
this.rb_Open.UseVisualStyleBackColor = true;
this.rb_Open.CheckedChanged += new System.EventHandler(this.rb_Open_CheckedChanged);
//
//
// rb_Close
//
//
this.rb_Close.AutoSize = true;
this.rb_Close.Location = new System.Drawing.Point(99, 222);
this.rb_Close.Name = "rb_Close";
@@ -67,9 +67,9 @@ namespace ZigBee路灯
this.rb_Close.Text = "关";
this.rb_Close.UseVisualStyleBackColor = true;
this.rb_Close.CheckedChanged += new System.EventHandler(this.rb_Close_CheckedChanged);
//
//
// groupBox1
//
//
this.groupBox1.Controls.Add(this.btn_open);
this.groupBox1.Controls.Add(this.com_port);
this.groupBox1.Controls.Add(this.lbl_Lamp);
@@ -79,9 +79,9 @@ namespace ZigBee路灯
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "配置";
//
//
// btn_open
//
//
this.btn_open.Location = new System.Drawing.Point(145, 77);
this.btn_open.Name = "btn_open";
this.btn_open.Size = new System.Drawing.Size(75, 23);
@@ -89,26 +89,26 @@ namespace ZigBee路灯
this.btn_open.Text = "打开";
this.btn_open.UseVisualStyleBackColor = true;
this.btn_open.Click += new System.EventHandler(this.btn_open_Click);
//
//
// com_port
//
//
this.com_port.FormattingEnabled = true;
this.com_port.Location = new System.Drawing.Point(90, 34);
this.com_port.Name = "com_port";
this.com_port.Size = new System.Drawing.Size(130, 20);
this.com_port.TabIndex = 1;
//
//
// lbl_Lamp
//
//
this.lbl_Lamp.AutoSize = true;
this.lbl_Lamp.Location = new System.Drawing.Point(21, 37);
this.lbl_Lamp.Name = "lbl_Lamp";
this.lbl_Lamp.Size = new System.Drawing.Size(29, 12);
this.lbl_Lamp.TabIndex = 0;
this.lbl_Lamp.Text = "路灯";
//
//
// Form1
//
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;