It depends on what you want, but it could be something as simple as:
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(ProcesControls(this));
}
private string ProcesControls(Control parent)
{
string s = "";
foreach (Control c in parent.Controls)
{
if (c.HasChildren)
s+=ProcesControls(c);
s += c.Text;
}
return s;
}
2
solved How to get the values of all controls of active form in one string and concatenate them? [closed]