From 7977cc5527a7b260a0c62348a76176895f2c832e Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 12 Apr 2018 15:05:43 +0800 Subject: [PATCH] bug --- WinFormControl/UWeightControl.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/WinFormControl/UWeightControl.cs b/WinFormControl/UWeightControl.cs index b22e66d..c97fdad 100644 --- a/WinFormControl/UWeightControl.cs +++ b/WinFormControl/UWeightControl.cs @@ -34,7 +34,6 @@ namespace WinFormControl public UWeightControl() { InitializeComponent(); - weightSwitch.FlatAppearance.BorderColor = Color.FromArgb(45, 155, 214); } [Browsable(false)] @@ -92,22 +91,18 @@ namespace WinFormControl ChangeWeightBtnState(); throw; } + finally + { + this.Focus(); + } } void ChangeWeightBtnState() { if (switchOn) - { - weightSwitch.BackgroundImage = Resources.onclickBtn; - weightSwitch.ForeColor = Color.White; weightSwitch.Text = "停止称重"; - } else - { - weightSwitch.BackgroundImage = Resources.simpleBtn; - weightSwitch.ForeColor = Color.Black; weightSwitch.Text = "启用称重"; - } } void OpenSerialPort()