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.

316 Day 8<br />

6. How many types of combo boxes are there?<br />

7. How is the ModalResult property used for button components?<br />

8. Which component is often used as a conta<strong>in</strong>er for other components?<br />

9. What is the return value from the Execute() method for an OpenDialog component<br />

if the user clicks OK to close the dialog box?<br />

10. How do you make the SaveDialog component <strong>in</strong>to a Save As dialog box?<br />

Exercises<br />

1. Create a program that conta<strong>in</strong>s two edit components. When the user types <strong>in</strong>formation<br />

<strong>in</strong> the first control, make it appear <strong>in</strong> the second edit control as it is<br />

entered.<br />

2. Create a program with a list box. Write code to load the list box from a text file<br />

prior to the application be<strong>in</strong>g visible.<br />

3. Add an edit component to the program <strong>in</strong> exercise 2. When the user selects an item<br />

<strong>in</strong> the list box, have the item’s text appear <strong>in</strong> the edit control.<br />

4. Add a button to the program <strong>in</strong> exercises 2 and 3. Write code so that when the<br />

button is clicked, any text <strong>in</strong> the edit control is added as a new item <strong>in</strong> the list box.<br />

5. Create a program that has a RadioGroup with four items <strong>in</strong> the group. Add a label<br />

component whose text changes depend<strong>in</strong>g on which radio button is clicked.<br />

6. Create a program that has a title on the form that is centered at the top of the form<br />

regardless of how the program’s w<strong>in</strong>dow is sized.<br />

7. Modify the program <strong>in</strong> exercise 6 so that the font of the title can be changed to any<br />

font available on the system by click<strong>in</strong>g a button.<br />

8. Reopen the Picture Viewer program created on Day 5. Modify the OpenDialog and<br />

SaveDialog components so that their Filter properties allow for selection of<br />

Bitmap (*.bmp), Metafile (*.wmf), Icon (*.ico), and All Files (*.*).

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

Saved successfully!

Ooh no, something went wrong!