I need to retrieve the text from a textbox within a custom control. The custom control is part of an ArrayList so there can be multiple custom controls displayed on a Form. How do I access the text from a single textbox within one of the controls in the ArrayList?
The code below shows how I'm creating the dynamic custom control:
ArrayList assessmentInfo = new ArrayList();
int length = (int)moduleInfoLevel6.numericUpDownModuleAssessmentNum.Value;
for (int i = 0; i < length; i++)
{
assessmentInfo.Add(new AssessmentInfo());
System.Drawing.Point p = new System.Drawing.Point(10, 160 + i * 32);
(assessmentInfo[i] as AssessmentInfo).Location = p;
(assessmentInfo[i] as AssessmentInfo).Size = new System.Drawing.Size(440, 32);
tabPageLevel6.Controls.Add((assessmentInfo[i] as AssessmentInfo));
}
Here are screenshots showing how the custom control is displayed:
assessmentInfo custom control
https://i.stack.imgur.com/EjbRw.jpg
How the custom control is displayed on the form