diff --git a/SunnyUI/Controls/UIComboDataGridView.cs b/SunnyUI/Controls/UIComboDataGridView.cs index 1325127a..49468fc2 100644 --- a/SunnyUI/Controls/UIComboDataGridView.cs +++ b/SunnyUI/Controls/UIComboDataGridView.cs @@ -20,7 +20,7 @@ * 2021-11-05: V3.0.8 增加过滤 * 2022-03-22: V3.1.1 增加自动过滤、单元格双击选中 * 2022-04-16: V3.1.3 增加行多选 - * 2022-06-16: V3.2.0 增加下拉框宽度 + * 2022-06-16: V3.2.0 增加下拉框宽度、高度 ******************************************************************************/ using System; @@ -48,13 +48,18 @@ namespace Sunny.UI this.ResumeLayout(false); this.PerformLayout(); - DropDownWidth = 333; + DropDownWidth = 500; + DropDownHeight = 300; } - [DefaultValue(333)] + [DefaultValue(500)] [Description("下拉框宽度"), Category("SunnyUI")] public int DropDownWidth { get; set; } + [DefaultValue(300)] + [Description("下拉框高度"), Category("SunnyUI")] + public int DropDownHeight { get; set; } + private void UIComboDataGridView_ButtonClick(object sender, EventArgs e) { item.FilterColumnName = FilterColumnName; @@ -64,7 +69,7 @@ namespace Sunny.UI item.SetDPIScale(); item.Translate(); //ItemForm.Show(this); - ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight())); + ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight)); } [DefaultValue(typeof(Size), "320, 240"), Description("下拉弹框界面大小"), Category("SunnyUI")] diff --git a/SunnyUI/Controls/UIComboTreeView.cs b/SunnyUI/Controls/UIComboTreeView.cs index 2aba97a3..61e141c7 100644 --- a/SunnyUI/Controls/UIComboTreeView.cs +++ b/SunnyUI/Controls/UIComboTreeView.cs @@ -19,6 +19,7 @@ * 2021-07-29: V3.0.5 修复SelectedNode=null的问题 * 2021-11-11: V3.0.0 增加文件说明 * 2022-05-15: V3.0.8 显示CheckBoxes时自己选中节点文字可切换状态 + * 2022-06-16: V3.2.0 增加下拉框宽度、高度 ******************************************************************************/ using System; @@ -53,8 +54,18 @@ namespace Sunny.UI this.ResumeLayout(false); this.PerformLayout(); + DropDownWidth = 250; + DropDownHeight = 220; } + [DefaultValue(250)] + [Description("下拉框宽度"), Category("SunnyUI")] + public int DropDownWidth { get; set; } + + [DefaultValue(220)] + [Description("下拉框高度"), Category("SunnyUI")] + public int DropDownHeight { get; set; } + public Control ExToolTipControl() { return edit; @@ -180,7 +191,8 @@ namespace Sunny.UI item.CanSelectRootNode = CanSelectRootNode; item.Translate(); item.SetDPIScale(); - ItemForm.Show(this); + //ItemForm.Show(this); + ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight)); } [DefaultValue(typeof(Size), "250, 220"), Description("下拉弹框界面大小"), Category("SunnyUI")]