Disabling a window or control

disable, disable_tabstop

Disable a window or control


disable | disable_tabstop object_id [, object_id]…

Disable the object or objects specified.

All windows and window controls are initially enabled unless assigned the style flag WS_DISABLED in their definition. The disable and enable commands are used to change this state at run time. The style WS_NOTABSTOP disables a control without changing its appearance.

If the disable command is used, the label of a window object is displayed in faint text. The disable_tabstop command has no effect on the appearance of an object. The disable_tabstop command and the style flag WS_NOTABSTOP have an identical effect, preventing the object from receiving input focus. See Style flags.

Different object types may be freely mixed. The object(s) to be disabled may be any of the following:


A window. The objects inside the window are effectively disabled themselves, and no events can occur within the window. However, this is not the same as individually disabling them. When the window is re-enabled, the objects retain their own enabled/disabled status.


A textbox group or button group. All the objects within the group are disabled. This does not change the disabled/enabled status of controls in the group. It over-rides it. If the group is re-enabled, the controls revert to their own individual disabled/enabled status.

box_id, button_id, listbox_id, table_id

A disabled textbox, button, listbox or table is not permitted to receive input focus in the dialog command, and is skipped if it occurs in the input list of an input command. The control’s label is displayed in faint text.


A disabled menu item cannot be selected. disable_tabstop cannot be used on a menu item.


A disabled static text item is displayed in faint text, and its hotkey, if any, cannot be activated.


Disable a window:

disable Window2

Disable a group:

disable MyWindow.PBGroup

Disable a textbox without changing its appearance:

disable_tabstop Box54