From 20bcf1f3e5ab83e1fb55cedee6b5f8c0c770f133 Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 4 May 2023 21:48:31 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIImageButton:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6PerformCl?= =?UTF-8?q?ick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIImageButton.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SunnyUI/Controls/UIImageButton.cs b/SunnyUI/Controls/UIImageButton.cs index 51b125f2..5bd2e9c5 100644 --- a/SunnyUI/Controls/UIImageButton.cs +++ b/SunnyUI/Controls/UIImageButton.cs @@ -18,6 +18,7 @@ * * 2020-01-01: V2.2.0 增加文件说明 * 2022-03-19: V3.1.1 重构主题配色 + * 2023-05-04: V3.3.6 增加调用点击事件PerformClick ******************************************************************************/ using System; @@ -44,6 +45,22 @@ namespace Sunny.UI private ContentAlignment textAlign = ContentAlignment.MiddleCenter; private Color foreColor = UIFontColor.Primary; + private bool isClick; + + /// + /// 调用点击事件 + /// + public void PerformClick() + { + if (isClick) return; + if (Enabled) + { + isClick = true; + OnClick(EventArgs.Empty); + isClick = false; + } + } + /// /// 禁止控件跟随窗体缩放 ///