From 2ea8cbf7256943978cb40228e43c0d2056c654b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E5=82=91?= <840465812@qq.com> Date: Wed, 28 Apr 2021 22:39:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=A2=9E=E5=8A=A0=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=83=AD=E9=94=AE=E5=89=8D=E8=AF=A2=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KeyGo/UCHotKeyItem.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/KeyGo/UCHotKeyItem.cs b/KeyGo/UCHotKeyItem.cs index 4dcdcfd..aa13180 100644 --- a/KeyGo/UCHotKeyItem.cs +++ b/KeyGo/UCHotKeyItem.cs @@ -120,15 +120,18 @@ namespace KeyGo /// private void BtnDel_Click(object sender, EventArgs e) { - try + if (MessageBox.Show("是否确定删除该热键?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - KeyGo.DelHotKey(HotKeyItem); - Parent?.Controls.Remove(this); - OnValueChanged(); - } - catch (Exception ex) - { - MessageBox.Show("在注销热键时异常:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); + try + { + KeyGo.DelHotKey(HotKeyItem); + Parent?.Controls.Remove(this); + OnValueChanged(); + } + catch (Exception ex) + { + MessageBox.Show("在注销热键时异常:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } }