Skip to content

Commit

Permalink
Merge pull request #14 from narozeol/work
Browse files Browse the repository at this point in the history
修复了关闭到托盘后使用alt+tap仍然能看见任务的bug
  • Loading branch information
NaroZeol authored Oct 24, 2023
2 parents 4675fa9 + 1f90d83 commit 72733ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Binary file added Program/Normal.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions Program/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>Normal.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<Content Include="Normal.ico" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.53" />
</ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion Program/src/Extensions/AppendTextExtension.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace MainFunction;
using System.Runtime.InteropServices;

namespace MainFunction;
static class AppendTextExtension
{
public static void AppendTextColorful(this RichTextBox rtBox, string addtext, Color color, int addNewLine = 1)
Expand Down
11 changes: 7 additions & 4 deletions Program/src/UI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace WinFormsApp1
{
public partial class Form1 : Form
{
{
public Form1()
{
InitializeComponent();
Expand Down Expand Up @@ -123,11 +123,13 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;

this.WindowState = FormWindowState.Minimized;
this.Hide();

this.ShowInTaskbar = false;
//this.WindowState = FormWindowState.Minimized;

NoticeIcon.Visible = true;
//this.ShowInTaskbar = false;

//NoticeIcon.Visible = true;
}

private void NoticeIcon_MouseClick(object sender, MouseEventArgs e)
Expand All @@ -138,6 +140,7 @@ private void NoticeIcon_MouseClick(object sender, MouseEventArgs e)
}
else
{
this.Show();
this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;
}
Expand Down

0 comments on commit 72733ab

Please sign in to comment.