From fb86b13948253f8e9891851b99008537baacffcc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:22:15 +0000 Subject: [PATCH 1/2] Initial plan From 0e666efaad14180d5f7e2378b55cbe60ca928bdc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:26:14 +0000 Subject: [PATCH 2/2] Add autofocus to password field in FrmPassword form Co-authored-by: Kvarkas <3611964+Kvarkas@users.noreply.github.com> --- mRemoteNG/UI/Forms/FrmPassword.cs | 7 ++++++- mRemoteNGTests/UI/Forms/PasswordFormTests.cs | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mRemoteNG/UI/Forms/FrmPassword.cs b/mRemoteNG/UI/Forms/FrmPassword.cs index 329df7d2c..d37760dcb 100644 --- a/mRemoteNG/UI/Forms/FrmPassword.cs +++ b/mRemoteNG/UI/Forms/FrmPassword.cs @@ -61,9 +61,14 @@ namespace mRemoteNG.UI.Forms pbLock.Image = display.ScaleImage(pbLock.Image); Height = tableLayoutPanel1.Height; - if (NewPasswordMode) return; + if (NewPasswordMode) + { + txtPassword.Focus(); + return; + } lblVerify.Visible = false; txtVerify.Visible = false; + txtPassword.Focus(); } private void PasswordForm_FormClosed(object sender, FormClosedEventArgs e) diff --git a/mRemoteNGTests/UI/Forms/PasswordFormTests.cs b/mRemoteNGTests/UI/Forms/PasswordFormTests.cs index 9301bc370..6e1dcaedc 100644 --- a/mRemoteNGTests/UI/Forms/PasswordFormTests.cs +++ b/mRemoteNGTests/UI/Forms/PasswordFormTests.cs @@ -45,5 +45,15 @@ namespace mRemoteNGTests.UI.Forms cancelButton.PerformClick(); Assert.That(eventFired, Is.True); } + + [Test] + public void PasswordFieldHasAutofocus() + { + // Find the password textbox control + TextBox passwordTextBox = _passwordForm.FindControl("txtPassword"); + + // Verify that the password field has focus when the form is loaded + Assert.That(passwordTextBox.Focused, Is.True, "Password field should have autofocus when form loads"); + } } } \ No newline at end of file