WinformsApp1/WinFormsApp1/Form1.Designer.cs
Developer ee620a3255 转换为通用WinForms应用模板
## 主要功能
- 清理Excel合并业务逻辑,保留基础框架
- 单exe打包配置(ILRepack示例)
- 应用图标和UI按钮图标配置
- .NET Framework 4.8环境检测
- 通用UI界面(文件夹选择、日志显示等)

## 模板用途
可直接作为新WinForms项目的基础模板
- 只需添加具体业务逻辑即可
- 支持Win7兼容性
- 完整的打包和图标配置示例

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 14:45:46 +08:00

197 lines
6.8 KiB
C#

using System;
using System.Windows.Forms;
using System.Drawing;
namespace WinFormsAppTemplate
{
partial class Form1
{
/// <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 Windows Form 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();
// 主窗体设置
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(600, 400);
Text = "WinForms应用模板";
StartPosition = FormStartPosition.CenterScreen;
// 创建控件
grpSourceFolder = new GroupBox();
lblSourcePath = new Label();
txtSourcePath = new TextBox();
btnBrowseSource = new Button();
grpOutputFolder = new GroupBox();
lblOutputPath = new Label();
txtOutputPath = new TextBox();
btnBrowseOutput = new Button();
pnlButtons = new Panel();
btnMerge = new Button();
btnClear = new Button();
btnExit = new Button();
grpProgress = new GroupBox();
progressBar = new ProgressBar();
txtLog = new TextBox();
// 设置源文件夹组
grpSourceFolder.Text = "输入文件夹";
grpSourceFolder.Location = new Point(10, 10);
grpSourceFolder.Size = new Size(580, 60);
grpSourceFolder.TabStop = false;
lblSourcePath.Text = "路径:";
lblSourcePath.Location = new Point(10, 25);
lblSourcePath.Size = new Size(30, 23);
txtSourcePath.Location = new Point(45, 22);
txtSourcePath.Size = new Size(470, 23);
btnBrowseSource.Text = "";
btnBrowseSource.Location = new Point(520, 20);
btnBrowseSource.Size = new Size(50, 25);
btnBrowseSource.Click += new EventHandler(btnBrowseSource_Click);
// 设置浏览按钮图标
try
{
btnBrowseSource.Image = Image.FromFile("app.ico");
btnBrowseSource.ImageAlign = ContentAlignment.MiddleCenter;
}
catch
{
// 如果图标加载失败,显示文字
btnBrowseSource.Text = "浏览";
}
grpSourceFolder.Controls.Add(lblSourcePath);
grpSourceFolder.Controls.Add(txtSourcePath);
grpSourceFolder.Controls.Add(btnBrowseSource);
// 设置输出文件夹组
grpOutputFolder.Text = "输出文件夹";
grpOutputFolder.Location = new Point(10, 80);
grpOutputFolder.Size = new Size(580, 60);
grpOutputFolder.TabStop = false;
lblOutputPath.Text = "路径:";
lblOutputPath.Location = new Point(10, 25);
lblOutputPath.Size = new Size(30, 23);
txtOutputPath.Location = new Point(45, 22);
txtOutputPath.Size = new Size(470, 23);
btnBrowseOutput.Text = "";
btnBrowseOutput.Location = new Point(520, 20);
btnBrowseOutput.Size = new Size(50, 25);
btnBrowseOutput.Click += new EventHandler(btnBrowseOutput_Click);
// 设置浏览按钮图标
try
{
btnBrowseOutput.Image = Image.FromFile("app.ico");
btnBrowseOutput.ImageAlign = ContentAlignment.MiddleCenter;
}
catch
{
// 如果图标加载失败,显示文字
btnBrowseOutput.Text = "浏览";
}
grpOutputFolder.Controls.Add(lblOutputPath);
grpOutputFolder.Controls.Add(txtOutputPath);
grpOutputFolder.Controls.Add(btnBrowseOutput);
// 设置按钮面板
pnlButtons.Location = new Point(10, 150);
pnlButtons.Size = new Size(580, 40);
btnMerge.Text = "执行";
btnMerge.Location = new Point(10, 8);
btnMerge.Size = new Size(75, 25);
btnMerge.Click += new EventHandler(btnMerge_Click);
btnClear.Text = "清空";
btnClear.Location = new Point(100, 8);
btnClear.Size = new Size(75, 25);
btnClear.Click += new EventHandler(btnClear_Click);
btnExit.Text = "退出";
btnExit.Location = new Point(190, 8);
btnExit.Size = new Size(75, 25);
btnExit.Click += new EventHandler(btnExit_Click);
pnlButtons.Controls.Add(btnMerge);
pnlButtons.Controls.Add(btnClear);
pnlButtons.Controls.Add(btnExit);
// 设置进度组
grpProgress.Text = "进度";
grpProgress.Location = new Point(10, 200);
grpProgress.Size = new Size(580, 180);
grpProgress.TabStop = false;
progressBar.Location = new Point(10, 25);
progressBar.Size = new Size(560, 23);
progressBar.Style = ProgressBarStyle.Continuous;
txtLog.Location = new Point(10, 55);
txtLog.Size = new Size(560, 115);
txtLog.Multiline = true;
txtLog.ScrollBars = ScrollBars.Vertical;
txtLog.ReadOnly = true;
grpProgress.Controls.Add(progressBar);
grpProgress.Controls.Add(txtLog);
// 添加所有控件到窗体
Controls.Add(grpSourceFolder);
Controls.Add(grpOutputFolder);
Controls.Add(pnlButtons);
Controls.Add(grpProgress);
}
#endregion
private GroupBox grpSourceFolder;
private Label lblSourcePath;
private TextBox txtSourcePath;
private Button btnBrowseSource;
private GroupBox grpOutputFolder;
private Label lblOutputPath;
private TextBox txtOutputPath;
private Button btnBrowseOutput;
private Panel pnlButtons;
private Button btnMerge;
private Button btnClear;
private Button btnExit;
private GroupBox grpProgress;
private ProgressBar progressBar;
private TextBox txtLog;
}
}