0

我通常使用此代码清空表单的所有文本框,使用 bunifu 控件时它不起作用

 ```


public void Clear(Control c)
            {
                foreach(Control ct in c.Controls)
                {
                    if(ct.GetType() == typeof(TextBox) || ct.GetType() == typeof(ComboBox))
                    {
                        ct.Text = "";
                    }
                    if(ct.Controls.Count != 0)
                    {
                        Clear(ct);
                    }
                }
            }
4

1 回答 1

0

我已经使用此代码但已经无法正常工作。

 public void Clear(Control c)
            {
                foreach (Control ct in c.Controls.OfType<BunifuTextBox>())
                {
                    ct.Text = "";
    
                    if(ct.Controls.Count != 0)
                    {
                        Clear(ct);
                    }
                }
            }
于 2021-07-17T17:29:55.073 回答