* UIBreadcrumb: 增加Readonly,禁用鼠标点击,可通过代码设置ItemIndex

This commit is contained in:
Sunny 2023-09-17 20:28:59 +08:00
parent 0a6f8f5e65
commit 7b2bbd897f

View File

@ -21,6 +21,7 @@
* 2022-01-26: V3.1.0
* 2022-03-19: V3.1.1
* 2023-05-12: V3.3.6 DrawString函数
* 2023-09-17: V3.4.2 ReadonlyItemIndex
******************************************************************************/
using System;
@ -355,6 +356,7 @@ namespace Sunny.UI
protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
if (Readonly) return;
foreach (var pair in ClickArea)
{
if (e.Location.InRegion(pair.Value))
@ -364,5 +366,10 @@ namespace Sunny.UI
}
}
}
[DefaultValue(false)]
[Description("禁用鼠标点击可通过代码设置ItemIndex")]
[Category("SunnyUI")]
public bool Readonly { get; set; }
}
}