I have a winforms app which has to extract text from 50 text boxes found in different tabs and panels. So far i have been unable to find something that works. I have tried:
foreach (Control x in this.Controls)
{
if (x is NumericTextBox)
{
s = i.ToString() + ", " + ((NumericTextBox)x).Text;
Append_to_Template_File(s);
i++;
}
}
But this only goes through the textboxes on the form I have also found this answer, however I have not managed to make it work: Loop through Textboxes The top answer results in a number of error:
- Constraints are not allowed on non-generic declarations
- The type or namespace name 'TControl' could not be found
I'm new at using C# and i'm not quite sure how to solve the first error. If it helps, i'm using Visual Studio 2008 and .NET 3.5 Any suggestions?