Listboxes


Listboxes

A listbox is a list of items from which you can choose one or many. There are four common types of listboxes:


Standard listbox

A simple listbox is a rectangular control that contains one or more entries. If there are more entries than can be displayed in the space allotted, scrollbars will appear as well. Click an entry to select it. If the listbox allows multiple items to be selected simultaneously , hold down the Ctrl key while clicking or pressing the spacebar to select additional items, one-by-one, or use Shift-click to select a range of items (see Figure 3-13).

Figure 3-15. This listbox shows the bitmap files in your Windows folder, from which you can choose one to be your Desktop background image

Use the arrow keys to move up and down the list. Type a letter to jump to the first entry that begins with that letter; if there are a lot of items, you can type several letters, quickly in succession, to jump to the first item that begins with those letters .


Drop-down listbox

A drop-down listbox (see Figure 3-14) works much like a standard listbox, except that only the currently selected entry is shown. Click the down arrow to open the list and choose another item. Drop-down listboxes never allow multiple selections.

Figure 3-16. Drop-down listboxes work much like standard listboxes, except that they consume less screen real estate


Shortcuts

With the focus on a drop-down listbox, press the down arrow key to open the list, the arrow keys to navigate, and then the Tab key to jump to the next control, which will close the list automatically (press Esc to close the list without selecting a new item). If you press Enter to commit your selection, though, it might activate the default button (see "Buttons", Earlier in this chapter).


Combo box

A combo box is a hybrid between an input field and a drop-down listbox. You can type just like in an ordinary input field, or you can click the down arrow to choose an item from the list. If you click an item, that item's caption will be placed into the text field, at which point you can edit or move on. Often, a drop-down list contains a history of previous entries you've made into a text entry field; the Address Bar is essentially a glorified combo box.

The keyboard shortcuts are the same as for drop-down listboxes, shown above, and input fields (discussed earlier in this chapter). Additionally, you can begin typing, and then press the down arrow, and the first entry in the list that matches what you've typed (if any) will be selected automatically.


ListView (commonly known as Details)

An enhanced version of the standard listbox, the ListView control is what appears in folder windows and File Open/Save dialogs. It's commonly used to display lists of files, but it's not unusual to see this presentation for other types of data as well (see Figure 3-15).

Figure 3-17. ListView controls, like the one used for Explorer's Details View, are enhanced listboxes with multiple columns of information

The main advantage of this control is that it supports multiple, resizable columns, each of which has a header that can usually be clicked to sort the contents of the list (click again to reverse the sort order). Drag the lines dividing the headers to resize the width of columns or drag the headers to rearrange them. Double-click on column header separators to size columns automatically to the widest contents.

See Chapter 2 for more information on working with the folder window. Since folders use the common ListView control, almost anything that works with a folder will work with other ListView controls. For example, in addition to selecting multiple items with Ctrl and Shift, as described for standard listboxes, above, you can usually select multiple items by drawing a rubber band with your mouse as well.



Windows XP in a Nutshell
Windows XP in a Nutshell, Second Edition
ISBN: 0596009003
EAN: 2147483647
Year: 2003
Pages: 266

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net