From b93b8f7432e84d7dd01f78df81951303203f1cde Mon Sep 17 00:00:00 2001 From: Developer Date: Thu, 20 Nov 2025 15:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=BA=94=E7=94=A8=EF=BC=9A?= =?UTF-8?q?=E5=8F=AA=E4=BF=9D=E7=95=99=E7=AA=97=E5=8F=A3=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E5=AE=B9=E6=94=B9=E4=B8=BAHelloWorld?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除按钮图标,只保留窗体图标显示 - 将功能内容简化为HelloWorld消息 - 保留完整的模板结构供后续开发 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- WinFormsApp1/Form1.Designer.cs | 34 ++-------------------------------- WinFormsApp1/Form1.cs | 4 ++-- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/WinFormsApp1/Form1.Designer.cs b/WinFormsApp1/Form1.Designer.cs index 57143d3..2846cc1 100644 --- a/WinFormsApp1/Form1.Designer.cs +++ b/WinFormsApp1/Form1.Designer.cs @@ -73,25 +73,10 @@ namespace WinFormsAppTemplate txtSourcePath.Location = new Point(45, 22); txtSourcePath.Size = new Size(470, 23); - btnBrowseSource.Text = ""; + btnBrowseSource.Text = "浏览"; btnBrowseSource.Location = new Point(520, 20); btnBrowseSource.Size = new Size(50, 25); btnBrowseSource.Click += new EventHandler(btnBrowseSource_Click); - // 设置浏览按钮图标 - try - { - var stream = GetType().Assembly.GetManifestResourceStream("WinFormsAppTemplate.app.ico"); - if (stream != null) - { - btnBrowseSource.Image = Image.FromStream(stream); - btnBrowseSource.ImageAlign = ContentAlignment.MiddleCenter; - } - } - catch - { - // 如果图标加载失败,显示文字 - btnBrowseSource.Text = "浏览"; - } grpSourceFolder.Controls.Add(lblSourcePath); grpSourceFolder.Controls.Add(txtSourcePath); @@ -110,25 +95,10 @@ namespace WinFormsAppTemplate txtOutputPath.Location = new Point(45, 22); txtOutputPath.Size = new Size(470, 23); - btnBrowseOutput.Text = ""; + btnBrowseOutput.Text = "浏览"; btnBrowseOutput.Location = new Point(520, 20); btnBrowseOutput.Size = new Size(50, 25); btnBrowseOutput.Click += new EventHandler(btnBrowseOutput_Click); - // 设置浏览按钮图标 - try - { - var stream = GetType().Assembly.GetManifestResourceStream("WinFormsAppTemplate.app.ico"); - if (stream != null) - { - btnBrowseOutput.Image = Image.FromStream(stream); - btnBrowseOutput.ImageAlign = ContentAlignment.MiddleCenter; - } - } - catch - { - // 如果图标加载失败,显示文字 - btnBrowseOutput.Text = "浏览"; - } grpOutputFolder.Controls.Add(lblOutputPath); grpOutputFolder.Controls.Add(txtOutputPath); diff --git a/WinFormsApp1/Form1.cs b/WinFormsApp1/Form1.cs index 5602b37..9fdd380 100644 --- a/WinFormsApp1/Form1.cs +++ b/WinFormsApp1/Form1.cs @@ -67,8 +67,8 @@ namespace WinFormsAppTemplate private void btnMerge_Click(object sender, EventArgs e) { - MessageBox.Show("这是一个模板项目\n\n功能:\n• 单exe打包\n• 应用图标配置\n• UI按钮图标\n• 环境检测\n\n请在此基础上开发你的具体功能", "模板项目", MessageBoxButtons.OK, MessageBoxIcon.Information); - Log("模板功能演示"); + MessageBox.Show("HelloWorld", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + Log("HelloWorld"); } private void Log(string msg)