* UIRadioButton: 修复CheckedChanged事件

This commit is contained in:
Sunny 2022-12-21 21:24:17 +08:00
parent 354a30dcb7
commit c846d340a1

View File

@ -21,6 +21,7 @@
* 2020-04-25: V2.2.4 * 2020-04-25: V2.2.4
* 2021-04-26: V3.0.3 CheckedChanged * 2021-04-26: V3.0.3 CheckedChanged
* 2022-03-19: V3.1.1 * 2022-03-19: V3.1.1
* 2022-12-21: V3.3.0 CheckedChanged事件
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -136,6 +137,8 @@ namespace Sunny.UI
{ {
get => _checked; get => _checked;
set set
{
if (_checked != value)
{ {
_checked = value; _checked = value;
@ -163,6 +166,7 @@ namespace Sunny.UI
Invalidate(); Invalidate();
} }
} }
}
/// <summary> /// <summary>
/// 绘制前景颜色 /// 绘制前景颜色
@ -231,7 +235,7 @@ namespace Sunny.UI
/// <param name="e">参数</param> /// <param name="e">参数</param>
protected override void OnClick(EventArgs e) protected override void OnClick(EventArgs e)
{ {
if (!ReadOnly) if (!ReadOnly && !Checked)
{ {
Checked = true; Checked = true;
} }