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);
}
}
}

原文地址:https://www.cnblogs.com/zttb/p/11504877.html