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")]