From 8f66290032797ca770fb40b4b6f88c42bb9b7935 Mon Sep 17 00:00:00 2001 From: Miepee Date: Sat, 3 Sep 2022 17:51:46 +0200 Subject: [PATCH] Make enter correctly work with tab controls --- .../AM2RLauncher/MainForm/CustomControls/CustomButton.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs b/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs index fe9b1de..8d19349 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs @@ -153,6 +153,13 @@ public class CustomButton : Drawable Invalidate(); } + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + if (e.KeyData == Keys.Enter && HasFocus) + OnClick(null); + } + /// /// Event raised when the mouse is released over this control's bounding box. ///