* UIImageButton: 增加调用点击事件PerformClick

This commit is contained in:
Sunny 2023-05-04 21:48:31 +08:00
parent f7c8020e5e
commit 20bcf1f3e5

View File

@ -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;
/// <summary>
/// 调用点击事件
/// </summary>
public void PerformClick()
{
if (isClick) return;
if (Enabled)
{
isClick = true;
OnClick(EventArgs.Empty);
isClick = false;
}
}
/// <summary>
/// 禁止控件跟随窗体缩放
/// </summary>