From 7b2bbd897f339ef14a38854aeb8d7517d6e60386 Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 17 Sep 2023 20:28:59 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIBreadcrumb:=20=E5=A2=9E=E5=8A=A0Readonly?= =?UTF-8?q?=EF=BC=8C=E7=A6=81=E7=94=A8=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E9=80=9A=E8=BF=87=E4=BB=A3=E7=A0=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEItemIndex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIBreadcrumb.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SunnyUI/Controls/UIBreadcrumb.cs b/SunnyUI/Controls/UIBreadcrumb.cs index f4f894f6..340293a2 100644 --- a/SunnyUI/Controls/UIBreadcrumb.cs +++ b/SunnyUI/Controls/UIBreadcrumb.cs @@ -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 增加Readonly,禁用鼠标点击,可通过代码设置ItemIndex ******************************************************************************/ 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; } } } \ No newline at end of file