Share this Page URL

Chapter 3. Making Your Programs Do What ... > Now What? Getting a Program to Do So... - Pg. 30

Making Your Programs Do What You Want Them to Do 30 Dealing with Dialog Boxes I mentioned earlier that after you select some menu commands, the program might require more info from you. For example, if you run a Print command, the program might want to know how many copies of the document you want to print. In these situations, the program sends an emissary to parley with you. These emissaries, called dialog boxes, are one of the most ubiquitous features in the Windows world. This section preps you for your dialog box conversations by showing you how to work with every type of dialog box control you're likely to encounter. (They're called controls because you use them to manipulate the different dialog box settings.) Before starting, it's important to keep in mind that most dialog boxes like to monopolize your attention. When one is on the screen, you usually can't do anything else in the program (such as select a pull-down menu). Deal with the dialog box first, and then you can move on to other things. Conveniently, the WordPad program offers a wide variety of dialog boxes, so I use it for most of the examples in this section. If you're following along, launch the program by selecting Start, All Pro- grams, Accessories, WordPad. Begin by selecting WordPad's View, Options command to have the Options dialog box report for duty, as shown in Figure 3.7. Figure 3.7. WordPad's Options dialog box demonstrates quite a few dialog box features. Okay, let's get started: · Command buttons--Clicking one of these buttons executes whatever command is written on the button. The two examples shown in the Options dialog box are the most common. You click OK to close the dialog box and put the settings into effect, and you click Cancel to close the dialog box without doing anything. · Check boxes--Windows uses a check box to toggle program features on and off. Clicking the check box either adds a check mark (meaning the feature will get turned on when you click OK) or removes the check mark (meaning the feature gets turned off when you click OK). · Option buttons--If a program feature offers three or more possibilities, the dialog box will offer an option button for each state, and only one button can be activated (that is, have a black dot inside its circle) at a time. You activate an option button by clicking it. · Tabs--Click any of the tabs displayed across the top of some dialog boxes and you see a new set of controls. (At this point, you no longer need the Options dialog box, so click Cancel to shut it down.)