Browse Source

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

pull/95/head
Sunny 2 years ago
parent
commit
afaec79519
  1. 10
      SunnyUI/Controls/UIComboBox.cs

10
SunnyUI/Controls/UIComboBox.cs

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

Loading…
Cancel
Save