DlgEnable, DlgEnable()

Syntax

DlgEnable Identifier[$] [On]

DlgEnable(Identifier[$])

Remarks

The DlgEnable statement is used within a dialog function to enable or disable the dialog box control identified by Identifier[$] while the dialog box is displayed. When a dialog box control is disabled, it is visible in the dialog box, but is dimmed and not functional.

For information about using a dialog function, see Chapter 5, "Working with Custom Dialog Boxes," in Part 1, "Learning WordBasic."

Argument

Explanation

Identifier[$]

The string or numeric identifier of the dialog box control

On

Enables or disables the dialog box control:

1 Enables the control

0 (zero) Disables the control

Omitted Toggles the control


The DlgEnable() function returns the following values.

Value

Explanation

–1

If the control is enabled

0 (zero)

If the control is disabled


Example

This example disables the dialog box control with the string identifier "Set" when the dialog box is initially displayed. (The main subroutine that contains the dialog box definition is not shown.)


Function MyDlgFunction(identifier$, action, suppvalue)
Select Case action
    Case 1                        'The dialog box is displayed
        DlgEnable "Set", 0
    Case 2                        'The user selects a control
        'Statements that perform actions based
        'on which control is selected go here
    Case 3                        'Text change (not applicable)
    Case Else
End Select
End Function

See Also

DlgVisible