Hi Folks
Working on a C# app to practice - I've been a VB.NET programmer for years and I'm trying to get used to working in C# now.
The app I'm writing includes over 80 text boxes in about 8 groups, each group in more or less in a grid pattern. They are named "txt<GroupName>1_1" for the box in the upper left corner, then "txt<GroupName>1_2" for the next box to the right and so on. The values to be displayed in the boxes are stored in an array in the code behind.
When I want to update the text value in a specific textbox I am having issues. I can derive the correct textbox name easily, but to update it I believe I need to iterate through the Controls collection (using a foreach function) until I find the correct textbox in order to get to its Text property. I know I have done this in VB by looking for the control type (because there are labels and command buttons on the form as well) and then reading its name - but I can't seem to find the control type as a property on the object in the Controls collection. Don't know what I'm doing wrong.
Can someone point me to the proper way to do this, or at least help me find the control type property?
Thanks
Craig
Working on a C# app to practice - I've been a VB.NET programmer for years and I'm trying to get used to working in C# now.
The app I'm writing includes over 80 text boxes in about 8 groups, each group in more or less in a grid pattern. They are named "txt<GroupName>1_1" for the box in the upper left corner, then "txt<GroupName>1_2" for the next box to the right and so on. The values to be displayed in the boxes are stored in an array in the code behind.
When I want to update the text value in a specific textbox I am having issues. I can derive the correct textbox name easily, but to update it I believe I need to iterate through the Controls collection (using a foreach function) until I find the correct textbox in order to get to its Text property. I know I have done this in VB by looking for the control type (because there are labels and command buttons on the form as well) and then reading its name - but I can't seem to find the control type as a property on the object in the Controls collection. Don't know what I'm doing wrong.
Can someone point me to the proper way to do this, or at least help me find the control type property?
Thanks
Craig