From 0e47254e87560ff00f4d2ceffe5f265e432e6156 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Sat, 28 Jan 2017 17:50:56 +0100 Subject: [PATCH] Adjusted Login Form --- Discord Media Loader/LoginForm.Designer.cs | 2 ++ Discord Media Loader/LoginForm.cs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/Discord Media Loader/LoginForm.Designer.cs b/Discord Media Loader/LoginForm.Designer.cs index 2aa16fb..fddb86d 100644 --- a/Discord Media Loader/LoginForm.Designer.cs +++ b/Discord Media Loader/LoginForm.Designer.cs @@ -61,6 +61,7 @@ this.tbxEmail.Name = "tbxEmail"; this.tbxEmail.Size = new System.Drawing.Size(204, 20); this.tbxEmail.TabIndex = 2; + this.tbxEmail.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbx_KeyUp); // // tbxPassword // @@ -69,6 +70,7 @@ this.tbxPassword.PasswordChar = '•'; this.tbxPassword.Size = new System.Drawing.Size(204, 20); this.tbxPassword.TabIndex = 3; + this.tbxPassword.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbx_KeyUp); // // btnLogin // diff --git a/Discord Media Loader/LoginForm.cs b/Discord Media Loader/LoginForm.cs index 582e364..2bd512e 100644 --- a/Discord Media Loader/LoginForm.cs +++ b/Discord Media Loader/LoginForm.cs @@ -41,5 +41,13 @@ namespace Discord_Media_Loader { DialogResult = DialogResult.OK; } + + private void tbx_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Return) + DialogResult = DialogResult.OK; + else if (e.KeyCode == Keys.Escape) + DialogResult = DialogResult.Abort; + } } }