* UIComboBox: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
* UIComboBox: 删除ScrollBarColor、ScrollBarBackColor、ScrollBarStyleInherited属性 * UIColorPicker: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题 * UIComboDataGridView: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题 * UIComboTreeView: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题 * UIDatePicker: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题 * UIDatetimePicker: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题 * UIDatePicker: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题 * UINumPadTextBox: 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
This commit is contained in:
parent
76b13321e6
commit
af41257d35
@ -20,7 +20,6 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
|
||||||
|
|
||||||
namespace Sunny.UI
|
namespace Sunny.UI
|
||||||
{
|
{
|
||||||
@ -53,24 +52,6 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public event EventHandler BeforeListClick;
|
public event EventHandler BeforeListClick;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 设置边框颜色
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="color">颜色</param>
|
|
||||||
public override void SetRectColor(Color color)
|
|
||||||
{
|
|
||||||
//listBox.ItemSelectBackColor = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 设置填充颜色
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="color">颜色</param>
|
|
||||||
public override void SetFillColor(Color color)
|
|
||||||
{
|
|
||||||
//ListBox.ItemSelectForeColor = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listBox_SelectedIndexChanged(object sender, EventArgs e)
|
private void listBox_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DoValueChanged(this, ListBox.SelectedValue);
|
DoValueChanged(this, ListBox.SelectedValue);
|
||||||
@ -83,5 +64,11 @@ namespace Sunny.UI
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void SetStyleColor(UIBaseStyle uiColor)
|
||||||
|
{
|
||||||
|
base.SetStyleColor(uiColor);
|
||||||
|
listBox.SetStyleColor(uiColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -89,6 +89,12 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 主题样式
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(UIStyle.Inherited), Description("下拉框主题样式"), Category("SunnyUI")]
|
||||||
|
public UIStyle StyleDropDown { get; set; } = UIStyle.Inherited;
|
||||||
|
|
||||||
public override void SetDPIScale()
|
public override void SetDPIScale()
|
||||||
{
|
{
|
||||||
base.SetDPIScale();
|
base.SetDPIScale();
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* 2021-03-13: V3.0.2 增加单击事件以选中颜色
|
* 2021-03-13: V3.0.2 增加单击事件以选中颜色
|
||||||
* 2022-03-10: V3.1.1 修复选中颜色不显示
|
* 2022-03-10: V3.1.1 修复选中颜色不显示
|
||||||
* 2024-08-05: V3.6.8 增加ShowDropDown()函数
|
* 2024-08-05: V3.6.8 增加ShowDropDown()函数
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* 文件名称: UIColorPicker.cs
|
* 文件名称: UIColorPicker.cs
|
||||||
* 文件说明: Color picker with color wheel and eye dropper
|
* 文件说明: Color picker with color wheel and eye dropper
|
||||||
@ -110,6 +111,7 @@ namespace Sunny.UI
|
|||||||
item.SelectedColor = Value;
|
item.SelectedColor = Value;
|
||||||
item.Translate();
|
item.Translate();
|
||||||
item.SetDPIScale();
|
item.SetDPIScale();
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
ItemForm.Show(this);
|
ItemForm.Show(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
* 2023-12-26: V3.6.2 增加下拉界面的滚动条设置
|
* 2023-12-26: V3.6.2 增加下拉界面的滚动条设置
|
||||||
* 2024-01-27: V3.6.3 修复在窗体构造函数设置SelectedIndex报错
|
* 2024-01-27: V3.6.3 修复在窗体构造函数设置SelectedIndex报错
|
||||||
* 2024-10-28: V3.7.2 增加了SelectionChangeCommitted事件,下拉框显示鼠标点击条目时响应
|
* 2024-10-28: V3.7.2 增加了SelectionChangeCommitted事件,下拉框显示鼠标点击条目时响应
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
|
* 2024-11-10: V3.7.2 删除ScrollBarColor、ScrollBarBackColor、ScrollBarStyleInherited属性
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -114,38 +116,6 @@ namespace Sunny.UI
|
|||||||
set => ListBox.ScrollBarHandleWidth = value;
|
set => ListBox.ScrollBarHandleWidth = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
|
||||||
/// </summary>
|
|
||||||
[Description("滚动条填充颜色"), Category("SunnyUI")]
|
|
||||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
|
||||||
public Color ScrollBarColor
|
|
||||||
{
|
|
||||||
get => ListBox.ScrollBarColor;
|
|
||||||
set => ListBox.ScrollBarColor = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
|
||||||
/// </summary>
|
|
||||||
[Description("滚动条背景颜色"), Category("SunnyUI")]
|
|
||||||
[DefaultValue(typeof(Color), "243, 249, 255")]
|
|
||||||
public Color ScrollBarBackColor
|
|
||||||
{
|
|
||||||
get => ListBox.ScrollBarBackColor;
|
|
||||||
set => ListBox.ScrollBarBackColor = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 滚动条主题样式
|
|
||||||
/// </summary>
|
|
||||||
[DefaultValue(true), Description("滚动条主题样式"), Category("SunnyUI")]
|
|
||||||
public bool ScrollBarStyleInherited
|
|
||||||
{
|
|
||||||
get => ListBox.ScrollBarStyleInherited;
|
|
||||||
set => ListBox.ScrollBarStyleInherited = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
[Description("显示清除按钮"), Category("SunnyUI")]
|
[Description("显示清除按钮"), Category("SunnyUI")]
|
||||||
public bool ShowClearButton
|
public bool ShowClearButton
|
||||||
@ -186,6 +156,8 @@ namespace Sunny.UI
|
|||||||
FilterItemForm.AutoClose = false;
|
FilterItemForm.AutoClose = false;
|
||||||
if (!FilterItemForm.Visible)
|
if (!FilterItemForm.Visible)
|
||||||
{
|
{
|
||||||
|
filterForm.Style = StyleDropDown;
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) filterForm.Style = StyleDropDown;
|
||||||
FilterItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight()));
|
FilterItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight()));
|
||||||
edit.Focus();
|
edit.Focus();
|
||||||
}
|
}
|
||||||
@ -757,6 +729,7 @@ namespace Sunny.UI
|
|||||||
dropWidth = Math.Max(DropDownWidth, dropWidth);
|
dropWidth = Math.Max(DropDownWidth, dropWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) dropForm.Style = StyleDropDown;
|
||||||
ItemForm.Show(this, new Size(dropWidth, CalcItemFormHeight()));
|
ItemForm.Show(this, new Size(dropWidth, CalcItemFormHeight()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
* 2023-07-25: V3.4.1 过滤输入后,按键盘下键切换至DataGridView,选中数据后按回车可快捷选中数据
|
* 2023-07-25: V3.4.1 过滤输入后,按键盘下键切换至DataGridView,选中数据后按回车可快捷选中数据
|
||||||
* 2023-09-25: V3.5.0 增加ClearFilter,可以清除弹窗的搜索栏文字
|
* 2023-09-25: V3.5.0 增加ClearFilter,可以清除弹窗的搜索栏文字
|
||||||
* 2024-03-22: V3.6.5 增加ShowDropDown()
|
* 2024-03-22: V3.6.5 增加ShowDropDown()
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -107,6 +108,7 @@ namespace Sunny.UI
|
|||||||
item.SetDPIScale();
|
item.SetDPIScale();
|
||||||
item.Translate();
|
item.Translate();
|
||||||
item.Filter1by1 = Filter1by1;
|
item.Filter1by1 = Filter1by1;
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
//ItemForm.Show(this);
|
//ItemForm.Show(this);
|
||||||
ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight));
|
ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight));
|
||||||
item.ComboDataGridViewFilterChanged += Item_ComboDataGridViewFilterChanged;
|
item.ComboDataGridViewFilterChanged += Item_ComboDataGridViewFilterChanged;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
* 2023-06-12: V3.3.8 修复使用清空按钮后,再次打开下拉框,上次的选择内容还是存在
|
* 2023-06-12: V3.3.8 修复使用清空按钮后,再次打开下拉框,上次的选择内容还是存在
|
||||||
* 2024-03-22: V3.6.5 增加ShowDropDown()
|
* 2024-03-22: V3.6.5 增加ShowDropDown()
|
||||||
* 2024-07-13: V3.6.7 修改下拉框全选按钮跟随主题,修改一处内置国际化翻译
|
* 2024-07-13: V3.6.7 修改下拉框全选按钮跟随主题,修改一处内置国际化翻译
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -260,6 +261,7 @@ namespace Sunny.UI
|
|||||||
item.Translate();
|
item.Translate();
|
||||||
item.SetDPIScale();
|
item.SetDPIScale();
|
||||||
//ItemForm.Show(this);
|
//ItemForm.Show(this);
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
int width = DropDownWidth < Width ? Width : DropDownWidth;
|
int width = DropDownWidth < Width ? Width : DropDownWidth;
|
||||||
width = Math.Max(250, width);
|
width = Math.Max(250, width);
|
||||||
item.ShowSelectedAllCheckBox = ShowSelectedAllCheckBox;
|
item.ShowSelectedAllCheckBox = ShowSelectedAllCheckBox;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
* 2024-06-09: V3.6.6 下拉框可选放大倍数为2
|
* 2024-06-09: V3.6.6 下拉框可选放大倍数为2
|
||||||
* 2024-07-13: V3.6.7 修改选择日期在下拉框中显示方式
|
* 2024-07-13: V3.6.7 修改选择日期在下拉框中显示方式
|
||||||
* 2024-08-28: V3.7.0 修复格式化字符串包含/时显示错误
|
* 2024-08-28: V3.7.0 修复格式化字符串包含/时显示错误
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -60,7 +61,7 @@ namespace Sunny.UI
|
|||||||
[Browsable(false)]
|
[Browsable(false)]
|
||||||
public override string[] FormTranslatorProperties => ["DateYearFormat", "DateYearMonthFormat", "DateFormat"];
|
public override string[] FormTranslatorProperties => ["DateYearFormat", "DateYearMonthFormat", "DateFormat"];
|
||||||
|
|
||||||
static internal DateTime EffectiveMaxDate(DateTime maxDate)
|
internal static DateTime EffectiveMaxDate(DateTime maxDate)
|
||||||
{
|
{
|
||||||
DateTime maxSupportedDate = DateTimePicker.MaximumDateTime;
|
DateTime maxSupportedDate = DateTimePicker.MaximumDateTime;
|
||||||
if (maxDate > maxSupportedDate)
|
if (maxDate > maxSupportedDate)
|
||||||
@ -70,7 +71,7 @@ namespace Sunny.UI
|
|||||||
return maxDate;
|
return maxDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
static internal DateTime EffectiveMinDate(DateTime minDate)
|
internal static DateTime EffectiveMinDate(DateTime minDate)
|
||||||
{
|
{
|
||||||
DateTime minSupportedDate = DateTimePicker.MinimumDateTime;
|
DateTime minSupportedDate = DateTimePicker.MinimumDateTime;
|
||||||
if (minDate < minSupportedDate)
|
if (minDate < minSupportedDate)
|
||||||
@ -370,6 +371,7 @@ namespace Sunny.UI
|
|||||||
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
||||||
item.max = MaxDate;
|
item.max = MaxDate;
|
||||||
item.min = MinDate;
|
item.min = MinDate;
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
|
|
||||||
Size size = SizeMultiple == 1 ? new Size(284, 200) : new Size(568, 400);
|
Size size = SizeMultiple == 1 ? new Size(284, 200) : new Size(568, 400);
|
||||||
ItemForm.Show(this, size);
|
ItemForm.Show(this, size);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
* 2024-06-09: V3.6.6 下拉框可选放大倍数为2
|
* 2024-06-09: V3.6.6 下拉框可选放大倍数为2
|
||||||
* 2024-07-13: V3.6.7 修改选择日期在下拉框中显示方式
|
* 2024-07-13: V3.6.7 修改选择日期在下拉框中显示方式
|
||||||
* 2024-08-28: V3.7.0 修复格式化字符串包含/时显示错误
|
* 2024-08-28: V3.7.0 修复格式化字符串包含/时显示错误
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -201,6 +202,7 @@ namespace Sunny.UI
|
|||||||
item.Translate();
|
item.Translate();
|
||||||
item.SetDPIScale();
|
item.SetDPIScale();
|
||||||
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
Size size = SizeMultiple == 1 ? new Size(452, 200) : new Size(904, 400);
|
Size size = SizeMultiple == 1 ? new Size(452, 200) : new Size(904, 400);
|
||||||
ItemForm.Show(this, size);
|
ItemForm.Show(this, size);
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
* 2023-03-26: V3.3.4 增加了最大值、最小值等属性
|
* 2023-03-26: V3.3.4 增加了最大值、最小值等属性
|
||||||
* 2023-06-11: V3.6.6 下拉框可选放大倍数为2
|
* 2023-06-11: V3.6.6 下拉框可选放大倍数为2
|
||||||
* 2024-09-03: V3.7.0 增加ShowDropDown()弹窗方法
|
* 2024-09-03: V3.7.0 增加ShowDropDown()弹窗方法
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -239,6 +240,7 @@ namespace Sunny.UI
|
|||||||
item.NumPadType = NumPadType;
|
item.NumPadType = NumPadType;
|
||||||
item.SetDPIScale();
|
item.SetDPIScale();
|
||||||
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
|
|
||||||
if (numPadType == NumPadType.IDNumber)
|
if (numPadType == NumPadType.IDNumber)
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* 2020-08-07: V2.2.7 可编辑输入
|
* 2020-08-07: V2.2.7 可编辑输入
|
||||||
* 2020-09-16: V2.2.7 更改滚轮选择时间的方向
|
* 2020-09-16: V2.2.7 更改滚轮选择时间的方向
|
||||||
* 2024-06-09: V3.6.6 下拉框可选放大倍数为2
|
* 2024-06-09: V3.6.6 下拉框可选放大倍数为2
|
||||||
|
* 2024-11-10: V3.7.2 增加StyleDropDown属性,手动修改Style时设置此属性以修改下拉框主题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -196,6 +197,7 @@ namespace Sunny.UI
|
|||||||
item.Translate();
|
item.Translate();
|
||||||
item.SetDPIScale();
|
item.SetDPIScale();
|
||||||
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
item.SetStyleColor(UIStyles.ActiveStyleColor);
|
||||||
|
if (StyleDropDown != UIStyle.Inherited) item.Style = StyleDropDown;
|
||||||
Size size = SizeMultiple == 1 ? new Size(168, 200) : new Size(336, 400);
|
Size size = SizeMultiple == 1 ? new Size(168, 200) : new Size(336, 400);
|
||||||
ItemForm.Show(this, size);
|
ItemForm.Show(this, size);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user