I am developing an application using Windows Form and C#. How can I add the Text
of all textboxes on the current tabpage to a List<string> Mydata
.
Here is my code below:
foreach(Control c in Controls){
if((c is TextBox) && (c.Text !="")){
if(c.Tag.ToString() == "500"){
StaticClass.Mydata.Items.Add(c.Text);
}
}
}
NB: Mydata (List) is public on a static class. I have a form with a tabcontrol which contains about 6 tabpages. The other tabpages have textboxes, too, but I want to retrieve only those in my example on tabindex 5.
Thanks.