Saving setting when window was deactivated

For situations when form closed not by [X] clicking
This commit is contained in:
Alexander 2019-11-27 19:22:48 +02:00
parent da954934f9
commit bd8c01a967
2 changed files with 6 additions and 0 deletions

View file

@ -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);

View file

@ -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