From fb3a35eee1fa74e47e8f7ac94bf3870aed3b0b02 Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 16 Jun 2022 15:58:41 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIComboTreeView:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E5=AE=BD=E5=BA=A6=E3=80=81=E9=AB=98?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIComboDataGridView.cs | 13 +++++++++---- SunnyUI/Controls/UIComboTreeView.cs | 14 +++++++++++++- 2 files changed, 22 insertions(+), 5 deletions(-) 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")]