Answer the question
In order to leave comments, you need to log in
How to refer to an element on a form by its TabIndex?
Hello! I have a form (WinForm), there are many textboxes, and I need to pull the values from these textboxes into the sheet by clicking on the button. I think that it is possible to somehow use the TabIndex of the elements, but manually prescribing each textBox is not correct and not beautiful. Please tell me how to do it right?
PS Thank you!
Answer the question
In order to leave comments, you need to log in
Decided like this:
Control saveControl = SystemGroupBox;
for (int i = 0; i < 12; i++)
{
Control textBox = this.GetNextControl(saveControl, true);
saveControl = textBox;
numberInt.Add(Convert.ToInt32(textBox.Text));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question