19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

316 <strong>Computer</strong> <strong>Programming</strong> <strong>Concepts</strong> <strong>and</strong> <strong>Visual</strong> <strong>Basic</strong><br />

msgFlex.GridLines = 0<br />

or<br />

msgFlex.GridLines = flexGridNone<br />

SUMMARY<br />

1. List boxes provide easy access to lists of strings. The lists can be automatically<br />

sorted (Sorted property = True), altered (AddItem, RemoveItem, <strong>and</strong> Clear<br />

methods), the currently highlighted item identified (Text property), <strong>and</strong> the number<br />

of items determined (ListCount property). The array List() holds the items<br />

stored in the list. Each item is identified by an index number (0, 1, 2, . . .). The<br />

most recently inserted item can be determined with the NewIndex property. The<br />

ItemData property associates a number with each item of text.<br />

2. Combo boxes are enhanced text boxes. They not only allow the user to enter<br />

information by typing it into a text box (read with the Text property), but allow<br />

the user to select the information from a list of items.<br />

3. Drive, directory, <strong>and</strong> file list boxes are specialized list boxes managed largely<br />

by Windows. The selected items are identified by the Drive, Path, <strong>and</strong> FileName<br />

properties, respectively. A directory list box always displays the subdirectories<br />

of the directory identified by its Path property, <strong>and</strong> a files list box displays the<br />

files in the directory identified by its Path property.<br />

4. Selections are made with check boxes (allow several) <strong>and</strong> option buttons (allow<br />

at most one). The state of the control (checked vs. unchecked or on vs. off) is<br />

stored in the Value property. Clicking on a check box toggles its state. Clicking<br />

on an option button gives it the on state <strong>and</strong> turns off the other option buttons<br />

in its group.<br />

5. Frames are used to group controls, especially option buttons, as a unit.<br />

6. Horizontal <strong>and</strong> vertical scroll bars permit the user to select from among a range<br />

of numbers by clicking or dragging with the mouse. The range is specified by<br />

the Min <strong>and</strong> Max properties, <strong>and</strong> new settings trigger the Click <strong>and</strong> Change<br />

events.<br />

7. The timer control triggers an event after a specified amount of time.<br />

8. The shape <strong>and</strong> line controls enhance the visual look of a form with rectangles,<br />

ovals, circles, <strong>and</strong> lines of different size, thickness, <strong>and</strong> color.<br />

9. The image control, which displays pictures or icons, can either exp<strong>and</strong> to<br />

accommodate the size of the drawing or have the drawing alter its size to fit the<br />

image control.<br />

10. A Microsoft FlexGrid control is a rectangular array of cells, each identified by<br />

a row <strong>and</strong> column number. The numbers of rows <strong>and</strong> columns are specified by<br />

the Rows <strong>and</strong> Cols properties. If the size of the grid is larger than provided by<br />

the control, scroll bars can be used to look at different parts of the grid. The<br />

FixedRows <strong>and</strong> FixedCols properties fix a certain number of the top rows <strong>and</strong><br />

leftmost columns so that they will not scroll. The Row <strong>and</strong> Col properties are<br />

used to designate one cell as current. The Text property is used to read or place<br />

text into the current cell.<br />

11. Menus, similar to the menus of <strong>Visual</strong> <strong>Basic</strong> itself, can be created with the<br />

Menu Design window.<br />

12. The clipboard is filled with the SetText method or by pressing Ctrl+C, <strong>and</strong> is<br />

copied with the GetText function or with Ctrl+V.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!