* UICombobox: Items.Clear后清除显示

This commit is contained in:
Sunny 2021-08-03 14:14:15 +08:00
parent 0435024bbc
commit dcee3e9960
5 changed files with 12 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -42,11 +42,21 @@ namespace Sunny.UI
ListBox.DisplayMemberChanged += Box_DisplayMemberChanged;
ListBox.ValueMemberChanged += Box_ValueMemberChanged;
ListBox.SelectedValueChanged += ListBox_SelectedValueChanged;
ListBox.ItemsCountChange += ListBox_ItemsCountChange;
edit.TextChanged += Edit_TextChanged;
DropDownWidth = 150;
fullControlSelect = true;
}
private void ListBox_ItemsCountChange(object sender, EventArgs e)
{
if (ListBox.Count == 0)
{
Text = "";
edit.Text = "";
}
}
public new EventHandler TextChanged;
private void Edit_TextChanged(object sender, EventArgs e)
@ -142,6 +152,7 @@ namespace Sunny.UI
private void UIComboBox_ButtonClick(object sender, EventArgs e)
{
if (Items.Count > 0)
ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight()));
}