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.

FIGURE 10-9 A Picture Created with Paint <strong>and</strong> Reduced Several Times<br />

COMMENTS<br />

1. When placing Line <strong>and</strong> Shape controls on a form, greater precision can be<br />

achieved by first turning off the “Align Controls to Grid” option in the General<br />

tab of the Options submenu of the Tools menu.<br />

2. Although frames cannot receive the focus, they can have an access key that<br />

sends the focus to the first control inside the frame that can receive the focus.<br />

3. You can paste a picture into an image control by copying it from your paint program<br />

<strong>and</strong> pressing Crl+V with the image control selected.<br />

10.3 FIVE ADDITIONAL OBJECTS<br />

In this section we discuss three controls <strong>and</strong> two objects that are not controls. The three controls<br />

are the Microsoft FlexGrid control (a custom control), the menu control (not accessed<br />

through the toolbox), <strong>and</strong> the common dialog box control (a custom control). The two objects<br />

are the clipboard <strong>and</strong> the form. The discussion of the form deals with the use of multiple<br />

forms.<br />

THE MICROSOFT FLEXGRID CONTROL<br />

Five Additional Objects 303<br />

The FlexGrid control does not initially appear in your Toolbox. To add the control, click on<br />

Components in the Project menu, click the Controls tab, <strong>and</strong> click on the check box to the left<br />

of “Microsoft FlexGrid Control 6.0.” Then press the OK button. By convention, names of<br />

Microsoft FlexGrids have the prefix msg.<br />

A grid is a rectangular array used to display tables or to create spreadsheet-like applications.<br />

The grid in Figure 10-10 has 6 rows <strong>and</strong> 7 columns. The number of rows <strong>and</strong> columns<br />

can be specified at design time with the Rows <strong>and</strong> Cols properties or at run time with statements<br />

such as msgFlex.Rows = 6 <strong>and</strong> msgFlex.Cols = 7. Rows <strong>and</strong> columns are numbered<br />

beginning with 0. For instance, the rows in Figure 10-10 are numbered (from top to bottom)<br />

as 0, 1, 2, 3, 4, <strong>and</strong> 5.

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

Saved successfully!

Ooh no, something went wrong!