From bd8c01a967a701b3c6fcdfce8b57318edc6e1606 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 27 Nov 2019 19:22:48 +0200 Subject: [PATCH] Saving setting when window was deactivated For situations when form closed not by [X] clicking --- Crypto Notepad/Forms/PasswordGeneratorFrom.Designer.cs | 1 + Crypto Notepad/Forms/PasswordGeneratorFrom.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Crypto Notepad/Forms/PasswordGeneratorFrom.Designer.cs b/Crypto Notepad/Forms/PasswordGeneratorFrom.Designer.cs index cfbceb8..7bf9d88 100644 --- a/Crypto Notepad/Forms/PasswordGeneratorFrom.Designer.cs +++ b/Crypto Notepad/Forms/PasswordGeneratorFrom.Designer.cs @@ -242,6 +242,7 @@ private void InitializeComponent() this.Name = "PasswordGeneratorFrom"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.Text = "Password Generator"; + this.Deactivate += new System.EventHandler(this.PasswordGeneratorFrom_Deactivate); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PasswordGeneratorFrom_FormClosing); this.Load += new System.EventHandler(this.PasswordGeneratorFrom_Load); this.groupBox1.ResumeLayout(false); diff --git a/Crypto Notepad/Forms/PasswordGeneratorFrom.cs b/Crypto Notepad/Forms/PasswordGeneratorFrom.cs index e623087..6ca6516 100644 --- a/Crypto Notepad/Forms/PasswordGeneratorFrom.cs +++ b/Crypto Notepad/Forms/PasswordGeneratorFrom.cs @@ -169,6 +169,11 @@ private void CopyAllButton_MouseEnter(object sender, EventArgs e) { passwordGeneratorToolTip.SetToolTip(copyAllButton, null); } + + private void PasswordGeneratorFrom_Deactivate(object sender, EventArgs e) + { + PasswordGeneratorFrom_FormClosing(null, null); + } #endregion