C # windows form Tab Order

I have a window form in a C # project that stores information about students. I caught the image: enter image description here

I want to add the data in sequential order as follows, but when I enter the data in the Surname text box, the TAB button goes into the E-Mail text box, then the Phone Number text box, and finally Date of Birth DateTimePicker.

I made all the TabStop property of the "False" control on the form, except for these text fields. And I organized their TabOrder through the properties section as follows 0,1,2 .. as I intend. But order followed, as I wrote above. Then I opened the deposit order function through the "View" in the menu bar. I clicked all the controls that I wanted to use in order, but did not use. The tab form and button function as before. I caught the image of the Order Order function below:

enter image description here

What should I do now?

+7
source share
1 answer

TabIndex is important for controls that are siblings of the same parent. However, if your TextBox and ComboBox controls are inside different parents, then their parent controls must have a corresponding TabIndex.

In Windows Forms Designer, you can see which controls are children of the panels, creating a document structure. Go to View β†’ Other Windows β†’ Document Structure.

If each TextBox or ComboBox is located directly inside the parent, then its TabIndex does not matter, it can be 0. It must be the parent (and possibly parent) TabIndex, which must be in order.

+12
source

Source: https://habr.com/ru/post/955607/


All Articles