From 90fcb70cb095adf37cb2d4a6a64979386ef8c105 Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 26 Dec 2023 21:27:04 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIComboBox:=20=E5=A2=9E=E5=8A=A0=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E7=95=8C=E9=9D=A2=E7=9A=84=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIComboBox.cs | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/SunnyUI/Controls/UIComboBox.cs b/SunnyUI/Controls/UIComboBox.cs index 145994d0..1b9bb9eb 100644 --- a/SunnyUI/Controls/UIComboBox.cs +++ b/SunnyUI/Controls/UIComboBox.cs @@ -38,6 +38,7 @@ * 2023-06-28: V3.3.9 增加过滤时忽略大小写 * 2023-07-03: V3.3.9 修改了几个对象的释放 * 2023-08-11: V3.4.1 Items.Clear后,DropDownStyle为DropDown时,不清空Text + * 2023-12-26: V3.6.2 增加下拉界面的滚动条设置 ******************************************************************************/ using System; @@ -80,6 +81,52 @@ namespace Sunny.UI CreateInstance(); } + [DefaultValue(0), Category("SunnyUI"), Description("垂直滚动条宽度,最小为原生滚动条宽度")] + public int ScrollBarWidth + { + get => ListBox.ScrollBarWidth; + set => ListBox.ScrollBarWidth = value; + } + + [DefaultValue(6), Category("SunnyUI"), Description("垂直滚动条滑块宽度,最小为原生滚动条宽度")] + public int ScrollBarHandleWidth + { + get => ListBox.ScrollBarHandleWidth; + set => ListBox.ScrollBarHandleWidth = value; + } + + /// + /// 填充颜色,当值为背景色或透明色或空值则不填充 + /// + [Description("滚动条填充颜色"), Category("SunnyUI")] + [DefaultValue(typeof(Color), "80, 160, 255")] + public Color ScrollBarColor + { + get => ListBox.ScrollBarColor; + set => ListBox.ScrollBarColor = value; + } + + /// + /// 填充颜色,当值为背景色或透明色或空值则不填充 + /// + [Description("滚动条背景颜色"), Category("SunnyUI")] + [DefaultValue(typeof(Color), "243, 249, 255")] + public Color ScrollBarBackColor + { + get => ListBox.ScrollBarBackColor; + set => ListBox.ScrollBarBackColor = value; + } + + /// + /// 滚动条主题样式 + /// + [DefaultValue(true), Description("滚动条主题样式"), Category("SunnyUI")] + public bool ScrollBarStyleInherited + { + get => ListBox.ScrollBarStyleInherited; + set => ListBox.ScrollBarStyleInherited = value; + } + [DefaultValue(false)] [Description("显示清除按钮"), Category("SunnyUI")] public bool ShowClearButton