diff --git a/src/HAClimateDeskband/FormSettings.Designer.cs b/src/HAClimateDeskband/FormSettings.Designer.cs index 8ffb55a..f1ca576 100644 --- a/src/HAClimateDeskband/FormSettings.Designer.cs +++ b/src/HAClimateDeskband/FormSettings.Designer.cs @@ -187,12 +187,14 @@ private void InitializeComponent() this.Controls.Add(this.BtnSave); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "FormSettings"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "HA Climate DeskBand"; this.Load += new System.EventHandler(this.FormSettings_Load); + this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.FormSettings_KeyPress); this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/HAClimateDeskband/FormSettings.cs b/src/HAClimateDeskband/FormSettings.cs index baf28d4..8ebf6b6 100644 --- a/src/HAClimateDeskband/FormSettings.cs +++ b/src/HAClimateDeskband/FormSettings.cs @@ -11,6 +11,8 @@ public partial class FormSettings : Form public FormSettings() { InitializeComponent(); + + Text += $" {typeof(FormSettings).Assembly.GetName().Version}"; } private void FormSettings_Load(object sender, EventArgs e) @@ -53,5 +55,13 @@ private void BtnSave_Click(object sender, EventArgs e) HAClimateDeskband.LoadSettings(); Close(); } + + private void FormSettings_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == Convert.ToChar(Keys.Escape)) + { + Close(); + } + } } }