diff --git a/Bin/SunnyUI.Demo.exe b/Bin/SunnyUI.Demo.exe index eed40046..6367bfab 100644 Binary files a/Bin/SunnyUI.Demo.exe and b/Bin/SunnyUI.Demo.exe differ diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 39a1d408..94677090 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FCombobox.Designer.cs b/SunnyUI.Demo/Controls/FCombobox.Designer.cs index 7cc8b0f8..41377f73 100644 --- a/SunnyUI.Demo/Controls/FCombobox.Designer.cs +++ b/SunnyUI.Demo/Controls/FCombobox.Designer.cs @@ -100,7 +100,6 @@ this.uiColorPicker1.TabIndex = 40; this.uiColorPicker1.Text = "uiColorPicker1"; this.uiColorPicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - this.uiColorPicker1.Value = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(159)))), ((int)(((byte)(254))))); // // uiLine7 // @@ -225,6 +224,7 @@ this.uiComboBox1.TabIndex = 32; this.uiComboBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiComboBox1.Watermark = "水印文字"; + this.uiComboBox1.DropDown += new System.EventHandler(this.uiComboBox1_DropDown); // // FCombobox // diff --git a/SunnyUI.Demo/Controls/FCombobox.cs b/SunnyUI.Demo/Controls/FCombobox.cs index e4df333c..ff317177 100644 --- a/SunnyUI.Demo/Controls/FCombobox.cs +++ b/SunnyUI.Demo/Controls/FCombobox.cs @@ -23,5 +23,14 @@ namespace Sunny.UI.Demo { uiTimePicker1.Value.ConsoleWriteLine(); } + + private void uiComboBox1_DropDown(object sender, EventArgs e) + { + uiComboBox1.Items.Clear(); + uiComboBox1.Items.Add("100"); + uiComboBox1.Items.Add("101"); + uiComboBox1.Items.Add("102"); + uiComboBox1.Items.Add("103"); + } } } diff --git a/SunnyUI/Controls/DropItem/UIDropControl.cs b/SunnyUI/Controls/DropItem/UIDropControl.cs index a9bd1cf1..66e425ab 100644 --- a/SunnyUI/Controls/DropItem/UIDropControl.cs +++ b/SunnyUI/Controls/DropItem/UIDropControl.cs @@ -127,6 +127,7 @@ namespace Sunny.UI { itemForm.ValueChanged += ItemForm_ValueChanged; itemForm.VisibleChanged += ItemForm_VisibleChanged; + itemForm.Closed += ItemForm_Closed; } } @@ -135,6 +136,11 @@ namespace Sunny.UI set => itemForm = value; } + private void ItemForm_Closed(object sender, ToolStripDropDownClosedEventArgs e) + { + DropDownClosed?.Invoke(this, null); + } + private void ItemForm_VisibleChanged(object sender, EventArgs e) { dropSymbol = SymbolNormal; @@ -363,13 +369,14 @@ namespace Sunny.UI ItemForm.SetStyle(UIStyles.ActiveStyleColor); } + DropDown?.Invoke(this, e); ButtonClick?.Invoke(this, e); } } - //public event EventHandler DropDown; + public event EventHandler DropDown; - //public event EventHandler DropDownClosed; + public event EventHandler DropDownClosed; public void Select(int start, int length) {