diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 1c33e5b0..62f7b457 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/Charts/FLineChart.cs b/SunnyUI.Demo/Charts/FLineChart.cs index c592d90e..a6ed0e8f 100644 --- a/SunnyUI.Demo/Charts/FLineChart.cs +++ b/SunnyUI.Demo/Charts/FLineChart.cs @@ -54,8 +54,8 @@ namespace Sunny.UI.Demo option.GreaterWarningArea = new UILineWarningArea(3.5); option.LessWarningArea = new UILineWarningArea(2.2, Color.Gold); - option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.Red, Name = "上限", Value = 3.5 }); - option.YAxisScaleLines.Add(new UIScaleLine() { Color = Color.Gold, Name = "下限", Value = 2.2 }); + option.YAxisScaleLines.Add(new UIScaleLine("上限", 3.5, Color.Red)); + option.YAxisScaleLines.Add(new UIScaleLine("下限", 2.2, Color.Gold)); option.XAxis.Name = "日期"; option.YAxis.Name = "数值"; diff --git a/SunnyUI/Controls/UISwitch.cs b/SunnyUI/Controls/UISwitch.cs index 19fe94d3..88a1112f 100644 --- a/SunnyUI/Controls/UISwitch.cs +++ b/SunnyUI/Controls/UISwitch.cs @@ -20,6 +20,7 @@ * 2020-04-25: V2.2.4 更新主题配置类 * 2021-05-06: V3.0.3 更新Active状态改变时触发ValueChanged事件 * 2021-09-14: V3.0.7 增加Disabled颜色 + * 2022-01-02: V3.0.9 增加是否只读属性 ******************************************************************************/ using System; @@ -59,6 +60,10 @@ namespace Sunny.UI fillColor = Color.White; } + [DefaultValue(false)] + [Description("是否只读"), Category("SunnyUI")] + public bool ReadOnly { get; set; } + private UISwitchShape switchShape = UISwitchShape.Round; [Description("开关形状"), Category("SunnyUI")] @@ -173,7 +178,7 @@ namespace Sunny.UI protected override void OnClick(EventArgs e) { - Active = !Active; + if (!ReadOnly) Active = !Active; base.OnClick(e); }