Disables and greys out a button added with the CreateButton macro.
Syntax
DisableButton("button-id")
DB("button-id")
Parameter | Description |
button-id | Identifier assigned to the button in the CreateButton macro. The button ID must be enclosed in quotation marks. |
Example
The following macro disables the Ideas button that was created in the example for the CreateButton macro:
DisableButton("btn_ideas")
Comments
You cannot use this macro to disable a button in a topic until the button has been enabled using the EnableButton macro.
If you use this macro to disable a standard Help button (Contents, Search, Back, or History), the user’s next action may reactivate the button. For example, when the user displays a new topic, the History and Back buttons will become enabled. Also, each time the history list is updated, Help refreshes the History button. The Contents and Search buttons remain disabled until the user chooses an interfile jump or executes an EnableButton macro.
When the BrowseButtons macro is used with one or more DisableButton macros, it may interfere with the results of the DisableButton macro. When it follows the DisableButton macros, the BrowseButtons macro forces the standard buttons to refresh, creating the same effect as if the DisableButton macro had failed. The order in the following example causes the standard buttons to be enabled rather than disabled:
[CONFIG]
DisableButton("btn_contents")
DisableButton("btn_search")
DisableButton("btn_back")
DisableButton("btn_history")
BrowseButtons()
To ensure that the DisableButton macro works as you intend it to, place the BrowseButtons macro first in the order:
[CONFIG]
BrowseButtons()
DisableButton("btn_contents")
DisableButton("btn_search")
DisableButton("btn_back")
DisableButton("btn_history")
You can also disable the Search button in a Help file by not assigning any keywords to the topics.
Windows Help ignores this macro if it is executed in a secondary window.
See Also
BrowseButtons, ChangeButtonBinding, CreateButton, DestroyButton, EnableButton