A graphical user interface (GUI) allows a user to interact visually with a program. A GUI (pronounced “GOO-ee”) gives a program a distinctive “look” and “feel.”
Consistent user interfaces enable a user to learn new apps more quickly because the apps have the same “look” and “feel.”
As an example of a GUI, consider Fig. 14.1, which shows a Visual Studio window containing various GUI controls. Near the top, there’s a menu bar containing the menus File, Edit, View, etc. Below that is a tool bar of buttons, each with a defined task, such as creating a new project or opening a file. Below that is a tab representing a currently open file—this tabbed view allows users to switch between the open files. These controls form a user-friendly interface through which you have been interacting with the IDE.
GUIs are built from GUI controls (which are sometimes called components or widgets—short for window gadgets). GUI controls are objects that can display information on the screen or enable users to interact with an app via the mouse, keyboard or some other form of input (such as voice commands). Several common GUI controls are listed in Fig. 14.2—in the sections that follow and in Chapter 15, we discuss each of these in detail. Chapter 15 explores the features and properties of additional GUI controls.
Control | Description |
---|---|
Label |
Displays images or uneditable text. |
TextBox |
Enables the user to enter data via the keyboard. It also can be used to display editable or uneditable text. |
Button |
Triggers an event when clicked with the mouse. |
CheckBox |
Specifies an option that can be selected (checked) or unselected (not checked). |
ComboBox |
Provides a drop-down list of items from which the user can make a selection either by clicking an item in the list or by typing in a box. |
ListBox |
Provides a list of items from which the user can make a selection by clicking one or more items. |
Panel |
A container in which controls can be placed and organized. |
NumericUpDown |
Enables the user to select from a range of numeric input values. |