wpf how to get all TextBoxes in wpf application

Posted by GC87 on Stack Overflow See other posts from Stack Overflow or by GC87
Published on 2011-01-02T10:28:29Z Indexed on 2011/01/02 10:54 UTC
Read the original article Hit count: 391

Filed under:

Hi,

I'm trying to learn how to do proper wpf application and now I have a big trouble. I know how I would do this if I had to do it with Windows Forms, but I don't know how to modify it to fit with wpf. Would someone know the answer? Here is my code for Windows Forms Form_loaded event:

foreach (Control ctrl in this.Controls)
        {
            if (ctrl is TextBox)
            {
                ctrl.Text = "";
            }
        }

© Stack Overflow or respective owner

Related posts about wpf