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)