OKButton

Syntax

OKButton HorizPos, VertPos, Width, Height [, .Identifier]

Remarks

Creates an OK button in a custom dialog box. If the user chooses the OK button, the dialog box closes and its settings are applied.

Argument

Explanation

HorizPos, VertPos

The horizontal and vertical distance of the upper-left corner of the OK button from the upper-left corner of the dialog box, in increments of 1/8 and 1/12 of the System font (Windows) or the dialog font (Macintosh).

Width, Height

The width and height of the OK button, in increments of 1/8 and 1/12 of the System font (Windows) or the dialog font (Macintosh).

.Identifier

An optional identifier used by statements in a dialog function that act on the OK button, such as DlgEnable and DlgVisible. If omitted, "OK" is the default identifier.


Note that choosing the OK button in a custom dialog box always returns –1 and choosing the Cancel button always returns 0 (zero). For example, in a dialog box displayed with the instruction x = Dialog(dlg), choosing OK sets the value of x to –1. The return value of other buttons is determined by the relative order of the PushButton statements in the dialog box definition.

For an example of OKButton used in a complete dialog box definition, see Begin Dialog¼End Dialog.

See Also

Begin Dialog¼End Dialog, CancelButton, PushButton