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()