* UICombobox: Items.Clear后清除显示
This commit is contained in:
parent
0435024bbc
commit
dcee3e9960
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -42,11 +42,21 @@ namespace Sunny.UI
|
|||||||
ListBox.DisplayMemberChanged += Box_DisplayMemberChanged;
|
ListBox.DisplayMemberChanged += Box_DisplayMemberChanged;
|
||||||
ListBox.ValueMemberChanged += Box_ValueMemberChanged;
|
ListBox.ValueMemberChanged += Box_ValueMemberChanged;
|
||||||
ListBox.SelectedValueChanged += ListBox_SelectedValueChanged;
|
ListBox.SelectedValueChanged += ListBox_SelectedValueChanged;
|
||||||
|
ListBox.ItemsCountChange += ListBox_ItemsCountChange;
|
||||||
edit.TextChanged += Edit_TextChanged;
|
edit.TextChanged += Edit_TextChanged;
|
||||||
DropDownWidth = 150;
|
DropDownWidth = 150;
|
||||||
fullControlSelect = true;
|
fullControlSelect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ListBox_ItemsCountChange(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ListBox.Count == 0)
|
||||||
|
{
|
||||||
|
Text = "";
|
||||||
|
edit.Text = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public new EventHandler TextChanged;
|
public new EventHandler TextChanged;
|
||||||
|
|
||||||
private void Edit_TextChanged(object sender, EventArgs e)
|
private void Edit_TextChanged(object sender, EventArgs e)
|
||||||
@ -142,7 +152,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
private void UIComboBox_ButtonClick(object sender, EventArgs e)
|
private void UIComboBox_ButtonClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight()));
|
if (Items.Count > 0)
|
||||||
|
ItemForm.Show(this, new Size(DropDownWidth < Width ? Width : DropDownWidth, CalcItemFormHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetStyleColor(UIBaseStyle uiColor)
|
public override void SetStyleColor(UIBaseStyle uiColor)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user