User interface design and focus

While a program executes, an interface control will often have focus -- it will be selected as the object for the next user action. For example, if a button is selected and the user hits the enter key, the program will behave as if he or she had clicked on the button or if a textbox has focus, any characters the user types will go into that textbox.

For example, the button with the caption Batente has focus when this exit program begins execution. As you see, it's appearance shows that it is selected, and, if the user hits the enter key, the program stops.

If the user hits the tab key, focus moves from the Batente button, to the Alto button, then to the Pare button, etc. This order is determined by the values of the TabIndex properties of the interface objects. The object with the TabIndex value of 0 will have focus initially, the one with a TabIndex value of 1 gains focus next, etc.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.