* UIComboBox: 增加Clear方法

* UIComboDataGridView; 增加Clear方法
* UIComboTreeView: 增加Clear方法
This commit is contained in:
Sunny 2022-11-30 20:27:12 +08:00
parent 989e074cdc
commit d5e65ac1b0
4 changed files with 29 additions and 1 deletions

View File

@ -351,7 +351,7 @@ namespace Sunny.UI
edit.Focus();
}
public void Clear()
public virtual void Clear()
{
edit.Clear();
}

View File

@ -32,6 +32,7 @@
* 2022-08-25: V3.2.3
* 2022-11-03: V3.2.6
* 2022-11-13: V3.2.8
* 2022-11-30: V3.3.0 Clear方法
******************************************************************************/
using System;
@ -74,6 +75,19 @@ namespace Sunny.UI
CreateInstance();
}
public override void Clear()
{
base.Clear();
if (DataSource != null)
{
DataSource = null;
}
else
{
ListBox.Items.Clear();
}
}
private void ListBox_Click(object sender, EventArgs e)
{
SelectTextChange = true;

View File

@ -26,6 +26,7 @@
* 2022-11-03: V3.2.6
* 2022-11-18: V3.2.9 Filter1by1
* 2022-11-18: V3.2.9
* 2022-11-30: V3.3.0 Clear方法
******************************************************************************/
using System;
@ -86,6 +87,12 @@ namespace Sunny.UI
item.ComboDataGridViewFilterChanged += Item_ComboDataGridViewFilterChanged;
}
public override void Clear()
{
base.Clear();
DataGridView.DataSource = null;
}
private void Item_ComboDataGridViewFilterChanged(object sender, UIComboDataGridViewArgs e)
{
FilterChanged?.Invoke(this, e);

View File

@ -21,6 +21,7 @@
* 2022-05-15: V3.0.8 CheckBoxes时自己选中节点文字可切换状态
* 2022-06-16: V3.2.0
* 2022-07-12: V3.2.1 CanSelectRootNode时可以展开子节点
* 2022-11-30: V3.3.0 Clear方法
******************************************************************************/
using System;
@ -76,6 +77,12 @@ namespace Sunny.UI
return edit;
}
public override void Clear()
{
base.Clear();
TreeView.Nodes.Clear();
}
/// <summary>
/// 重载字体变更
/// </summary>