Skip to content

Commit

Permalink
Fix issue #7. To make things easier the close button now is basically…
Browse files Browse the repository at this point in the history
… an alias to the minimize button. The NoseMouseClick now actually unhides and unminimizes the window instead of creating a new form.

It is similar to this SO answer: https://stackoverflow.com/a/23789316 so it should work.
  • Loading branch information
joanbm committed Feb 16, 2018
1 parent 5564f3d commit fa4aeb4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions QuietOnTheSetUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
Hide();
}
}

Expand Down Expand Up @@ -214,9 +212,10 @@ private void showPasswordCheckbox_CheckedChanged(object sender, EventArgs e)

private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
// Show must be called before setting WindowState,
// otherwise the window loses its size and position
this.Show();
this.WindowState = FormWindowState.Normal;
Form1 frm = new Form1();
frm.Show();
MaxmizedFromTray();
}

Expand Down

0 comments on commit fa4aeb4

Please sign in to comment.