M
M
Michael Vasyukov2017-10-10 16:39:27
.NET
Michael Vasyukov, 2017-10-10 16:39:27

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

1 answer(s)
M
Michael Vasyukov, 2017-10-10
@programmer_developer

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 question

Ask a Question

731 491 924 answers to any question