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.

NOTE<br />

Work<strong>in</strong>g with the Form Designer and the Menu Designer<br />

You don’t have to drag down and to the right. You can drag <strong>in</strong> any<br />

direction to select components.<br />

Select<strong>in</strong>g Multiple Items: Components With<strong>in</strong> Components<br />

Frequently you will have components placed with<strong>in</strong> other components. The Panel component<br />

is frequently used as a conta<strong>in</strong>er for other components. Speedbars are built this way, for<br />

example. To select a group of components on a panel, you have to hold down the Ctrl key<br />

on the keyboard while you drag to select the components. (Try it without hold<strong>in</strong>g down the<br />

Ctrl key and see what happens!) In case you’re wonder<strong>in</strong>g, yes, you can use a comb<strong>in</strong>ation<br />

of Ctrl+Shift+drag. (I suppose the <strong>Borland</strong> designers could have figured out some way of<br />

work<strong>in</strong>g the Alt key <strong>in</strong> there, too.)<br />

To illustrate, first start with a blank form. Then do the follow<strong>in</strong>g:<br />

1. Select a Panel component from the Component Palette and place it on the form<br />

us<strong>in</strong>g the drag method. Drag it so that it occupies most of the form.<br />

2. Now select a Button component and place six buttons on the form. Your form<br />

should look someth<strong>in</strong>g like Figure 7.4.<br />

3. Drag a bound<strong>in</strong>g rectangle around Button1, Button2, and Button3. You will<br />

notice that you moved the panel, which is not what you expected (and not what<br />

you wanted). Move the panel back to where it was.<br />

4. Hold down the Ctrl key and drag a rectangle around Button1, Button2, and<br />

Button3. The buttons are selected.<br />

5. Now hold down both the Ctrl and Shift keys and drag the bound<strong>in</strong>g rectangle<br />

around Button5 and Button6. Now all buttons are selected except Button4.<br />

Figure 7.4.<br />

The form with a<br />

panel and six buttons.<br />

225<br />

7

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

Saved successfully!

Ooh no, something went wrong!