12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

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.

162 Day 5<br />

3. Locate the Align property and change it to alClient. The picture component fills<br />

the client area of the form.<br />

4. Locate the Stretch property and change it to true.<br />

5. Locate the Picture property and double-click the Value column.<br />

6. The Picture Editor dialog box is displayed. Click the Load button. The File Open<br />

dialog box is displayed.<br />

7. Navigate to the \CBUILDER\IMAGES\SPLASH\256COLOR directory and choose an image<br />

from those presented (I like HANDSHAKE.BMP). Click OK.<br />

8. You are now back to the Image Editor dialog box, and the bitmap you chose is<br />

displayed <strong>in</strong> the preview w<strong>in</strong>dow. Click OK. (If you want to choose a different<br />

bitmap, click the Load button aga<strong>in</strong>.) The bitmap now fills the client area of the<br />

form.<br />

9. Click the Run button. When the application runs you can size the w<strong>in</strong>dow, and<br />

the bitmap will always fill the client area of the w<strong>in</strong>dow.<br />

See how easy it is? It would have been even easier if we hadn’t bothered to make the image<br />

fill the client area of the form. Figure 5.7 shows the bitmap test program runn<strong>in</strong>g.<br />

Figure 5.7.<br />

The bitmap test<br />

program runn<strong>in</strong>g.<br />

Summary<br />

Today you have learned about frameworks. You first learned about OWL and MFC and the<br />

role they have had <strong>in</strong> shap<strong>in</strong>g W<strong>in</strong>dows programm<strong>in</strong>g today. After that you learned about<br />

VCL and how it differs from the <strong>C++</strong> frameworks. We discussed properties, methods, and<br />

events, and you got a little hands-on experience <strong>in</strong> the process. We f<strong>in</strong>ished up today with<br />

an overview of the VCL classes that you are likely to encounter when programm<strong>in</strong>g <strong>in</strong><br />

<strong>C++</strong>Builder. I didn’t cover them all, but I gave you a brief look at the most commonly used<br />

classes.

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

Saved successfully!

Ooh no, something went wrong!