winform 重置快捷写法

private void BtnReset_Click(object sender, EventArgs e)
{
this.FindButton(this);
}
private void FindButton(Control c)
{
if (c.Controls != null)
{

foreach (Control x in c.Controls)
{
if (x is DevExpress.XtraEditors.TextEdit)
{
((DevExpress.XtraEditors.TextEdit)x).Text = "";
}
if (x is DevExpress.XtraEditors.LookUpEdit)
{
((DevExpress.XtraEditors.LookUpEdit)x).EditValue=null;
}
FindButton(x);
}
}
}

posted on 2019-09-11 10:41  Smile向前  阅读(458)  评论(0编辑  收藏  举报