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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6<br />

210 Day 6<br />

3. Change the Stretch property to true.<br />

4. Change the Align property to alClient. The Image component expands to fill the<br />

client area of the form.<br />

5. Choose File | Save and save the form’s unit as MDIChild.<br />

6. Switch to the Code Editor (press F12). Click on the ViewMa<strong>in</strong>.cpp tab. Now choose<br />

File | Include Unit Hdr from the ma<strong>in</strong> menu, select the MDIChild unit, and click<br />

OK. This is so the compiler is happy when we reference the TChild object.<br />

The form is pretty unimpressive at this po<strong>in</strong>t, but it should look similar to Figure 6.17.<br />

Figure 6.17.<br />

The MDI child form<br />

with an Image<br />

component.<br />

We still have to create the About box, but right now you’re probably eager to try the program.<br />

Go ahead and click the Run button. After a while, the program is displayed. You can choose<br />

File | Open and open any graphics file (any file with a .bmp, a .wmf, or an .ico extension, that<br />

is). Notice that the MDI child w<strong>in</strong>dow sizes itself to the graphic it conta<strong>in</strong>s. Open several files<br />

and then try the Cascade and Tile options under the W<strong>in</strong>dow menu. If you want, you can<br />

save a file with a different name us<strong>in</strong>g the File | Save As menu item.<br />

Step 5: Create the About Box<br />

By now you should know enough about <strong>C++</strong>Builder to create the About box on your own.<br />

Create the About box so that it looks someth<strong>in</strong>g like Figure 6.18. If you get stuck, you can<br />

jump back a few pages and review the steps you took to create the About box earlier <strong>in</strong> the<br />

chapter. Feel free to make your About box as personalized as you like.

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

Saved successfully!

Ooh no, something went wrong!