From 227b3a96ae9c471e0ba449946c7b2713fd35bff9 Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 16 Jun 2022 15:50:02 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIComboDataGridView:=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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIComboDataGridView.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SunnyUI/Controls/UIComboDataGridView.cs b/SunnyUI/Controls/UIComboDataGridView.cs index d77c1d1a..1325127a 100644 --- a/SunnyUI/Controls/UIComboDataGridView.cs +++ b/SunnyUI/Controls/UIComboDataGridView.cs @@ -20,6 +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 增加下拉框宽度 ******************************************************************************/ using System; @@ -46,8 +47,14 @@ namespace Sunny.UI this.ButtonClick += UIComboDataGridView_ButtonClick; this.ResumeLayout(false); this.PerformLayout(); + + DropDownWidth = 333; } + [DefaultValue(333)] + [Description("下拉框宽度"), Category("SunnyUI")] + public int DropDownWidth { get; set; } + private void UIComboDataGridView_ButtonClick(object sender, EventArgs e) { item.FilterColumnName = FilterColumnName; @@ -56,7 +63,8 @@ namespace Sunny.UI item.ShowButtons = true; item.SetDPIScale(); item.Translate(); - ItemForm.Show(this); + //ItemForm.Show(this); + ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight())); } [DefaultValue(typeof(Size), "320, 240"), Description("下拉弹框界面大小"), Category("SunnyUI")]