From 60b942b0479a16c74fd9a78c20bd7420de08b73b Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 19 Jun 2022 10:26:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?*=20UIComboDataGridView:=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0FilterChanged=EF=BC=8C=E8=BE=93=E5=87=BA=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=96=87=E5=AD=97=E5=92=8C=E8=AE=B0=E5=BD=95=E6=9D=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DropItem/UIComboDataGridViewItem.cs | 4 ++++ .../Controls/DropItem/UIToolStripDropDown.cs | 19 +++++++++++++++++++ SunnyUI/Controls/UIComboDataGridView.cs | 9 +++++++++ 3 files changed, 32 insertions(+) diff --git a/SunnyUI/Controls/DropItem/UIComboDataGridViewItem.cs b/SunnyUI/Controls/DropItem/UIComboDataGridViewItem.cs index f2bb7362..17fe8e62 100644 --- a/SunnyUI/Controls/DropItem/UIComboDataGridViewItem.cs +++ b/SunnyUI/Controls/DropItem/UIComboDataGridViewItem.cs @@ -15,6 +15,8 @@ namespace Sunny.UI private UISymbolButton btnClear; private UIDataGridView dataGridView; + public event OnComboDataGridViewFilterChanged ComboDataGridViewFilterChanged; + public UIComboDataGridViewItem() { InitializeComponent(); @@ -364,6 +366,8 @@ namespace Sunny.UI { table.DefaultView.RowFilter = filter; } + + ComboDataGridViewFilterChanged?.Invoke(this, new UIComboDataGridViewArgs(edtFilter.Text, dataGridView.RowCount)); } private void btnClear_Click(object sender, System.EventArgs e) diff --git a/SunnyUI/Controls/DropItem/UIToolStripDropDown.cs b/SunnyUI/Controls/DropItem/UIToolStripDropDown.cs index 7fd59c91..95029e46 100644 --- a/SunnyUI/Controls/DropItem/UIToolStripDropDown.cs +++ b/SunnyUI/Controls/DropItem/UIToolStripDropDown.cs @@ -201,4 +201,23 @@ namespace Sunny.UI itemForm.SetStyle(style); } } + + public delegate void OnComboDataGridViewFilterChanged(object sender, UIComboDataGridViewArgs e); + + public class UIComboDataGridViewArgs : EventArgs + { + public string FilterText { get; set; } + public int FilterCount { get; set; } + + public UIComboDataGridViewArgs() + { + + } + + public UIComboDataGridViewArgs(string filterText, int filterCount) + { + FilterText = filterText; + FilterCount = filterCount; + } + } } diff --git a/SunnyUI/Controls/UIComboDataGridView.cs b/SunnyUI/Controls/UIComboDataGridView.cs index 49468fc2..e3b044e1 100644 --- a/SunnyUI/Controls/UIComboDataGridView.cs +++ b/SunnyUI/Controls/UIComboDataGridView.cs @@ -21,6 +21,7 @@ * 2022-03-22: V3.1.1 增加自动过滤、单元格双击选中 * 2022-04-16: V3.1.3 增加行多选 * 2022-06-16: V3.2.0 增加下拉框宽度、高度 + * 2022-06-19: V3.2.0 增加FilterChanged,输出过滤文字和记录条数 ******************************************************************************/ using System; @@ -52,6 +53,8 @@ namespace Sunny.UI DropDownHeight = 300; } + public event OnComboDataGridViewFilterChanged FilterChanged; + [DefaultValue(500)] [Description("下拉框宽度"), Category("SunnyUI")] public int DropDownWidth { get; set; } @@ -70,6 +73,12 @@ namespace Sunny.UI item.Translate(); //ItemForm.Show(this); ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, DropDownHeight)); + item.ComboDataGridViewFilterChanged += Item_ComboDataGridViewFilterChanged; + } + + private void Item_ComboDataGridViewFilterChanged(object sender, UIComboDataGridViewArgs e) + { + FilterChanged?.Invoke(this, e); } [DefaultValue(typeof(Size), "320, 240"), Description("下拉弹框界面大小"), Category("SunnyUI")] From cbaffee71900f5cf211e0f3e281d714788c835fe Mon Sep 17 00:00:00 2001 From: Sunny Date: Sun, 19 Jun 2022 11:29:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?*=20UITabControl:=20=E5=A4=9A=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A1=86=E6=9E=B6=E5=85=B3=E9=97=AD=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=B6=E6=89=A7=E8=A1=8CUIPage=E7=9A=84FormClosed=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UITabControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SunnyUI/Controls/UITabControl.cs b/SunnyUI/Controls/UITabControl.cs index 320ee148..d0a51575 100644 --- a/SunnyUI/Controls/UITabControl.cs +++ b/SunnyUI/Controls/UITabControl.cs @@ -29,6 +29,7 @@ * 2022-04-20: V3.1.5 不显示标签页时屏蔽左右键 * 2022-05-11: V3.1.8 修复屏蔽左右键后其他控件无法使用左右键的问题 * 2022-05-17: V3.1.9 修复了一个首页无法关闭的问题 + * 2022-06-19: V3.2.0 多页面框架关闭页面时执行UIPage的FormClosed事件 ******************************************************************************/ using Sunny.UI.Win32; @@ -818,6 +819,7 @@ namespace Sunny.UI if (AutoClosePage) { pages[i].Final(); + pages[i].Close(); pages[i].Dispose(); pages[i] = null; }