* UIComboBox: Items.Clear后,DropDownStyle为DropDown时,不清空Text

This commit is contained in:
Sunny 2023-08-11 21:44:01 +08:00
parent 71660bd72f
commit afaec79519

View File

@ -37,6 +37,7 @@
* 2023-03-15: V3.3.3 * 2023-03-15: V3.3.3
* 2023-06-28: V3.3.9 * 2023-06-28: V3.3.9
* 2023-07-03: V3.3.9 * 2023-07-03: V3.3.9
* 2023-08-11: V3.4.1 Items.Clear后DropDownStyle为DropDown时Text
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -308,7 +309,7 @@ namespace Sunny.UI
private void ListBox_ItemsRemove(object sender, EventArgs e) private void ListBox_ItemsRemove(object sender, EventArgs e)
{ {
if (ListBox.Count == 0) if (ListBox.Count == 0 && DropDownStyle == UIDropDownStyle.DropDownList)
{ {
Text = ""; Text = "";
edit.Text = ""; edit.Text = "";
@ -317,8 +318,11 @@ namespace Sunny.UI
private void ListBox_ItemsClear(object sender, EventArgs e) private void ListBox_ItemsClear(object sender, EventArgs e)
{ {
Text = ""; if (DropDownStyle == UIDropDownStyle.DropDownList)
edit.Text = ""; {
Text = "";
edit.Text = "";
}
} }
public new event EventHandler TextChanged; public new event EventHandler TextChanged;