Dialog Box Controls

WordBasic supports most of the standard Windows and Macintosh dialog box controls. This section introduces the controls available for custom dialog boxes and provides guidelines for using them.

OK, Cancel, and Push Buttons

Every custom dialog box must contain at least one "command" button — an OK button, a Cancel button, or a push button. WordBasic includes separate dialog box definition statements for each of these three types of buttons. A common use for a push button is to display another dialog box.

List Boxes, Drop-Down List Boxes, and Combo Boxes

You use a list box, drop-down list box, or combo box to present a list of items from which the user can select. A drop-down list box saves space (it can drop down to cover other dialog box controls temporarily). A combo box allows the user either to select an item from the list or type a new item. The items displayed in a list box, drop-down list box, or combo box are stored in an array that is defined before the instructions that define the dialog box.

Check Boxes

You use a check box to make a "yes or no" or "on or off" choice. For example, you could use a check box to display or hide a toolbar or to apply or remove formatting for selected text.

Text Boxes and Text

A text box control is a box in which the user can enter text while the dialog box is displayed. By default, a text box holds a single line of text, but you can also size it to hold multiple lines of text (text wraps within a multiple-line text box, and the user can also press Enter to start a new line). A text control displays text that the user cannot change. It is often used to label a text box.

Option Buttons and Group Boxes

You use option buttons to allow the user to choose one option from several. Typically, you use a group box to surround a group of option buttons, but you can also use a group box to set off a group of check boxes or any related group of controls.

Pictures and File Preview

A custom dialog box can include graphics, or "pictures," and a file preview box, which displays a thumbnail representation of any Word document. A dialog box can include only one file preview box. A graphic can be stored as a file, an AutoText entry, an item marked with a bookmark in a document, or an item on the Clipboard.