Loop for all the bunifu Controls and one for the bunifu Textbox

74 Views Asked by At

I normaly use this code to empty all the textbox of my form,it doesn't work when using bunifu controls

 ```


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

There are 1 best solutions below

0
Mohammed El Attar On

i have use this code but already not work.

 public void Clear(Control c)
            {
                foreach (Control ct in c.Controls.OfType<BunifuTextBox>())
                {
                    ct.Text = "";
    
                    if(ct.Controls.Count != 0)
                    {
                        Clear(ct);
                    }
                }
            }