True DataControl 8.0 Reference > True DataControl Control > TData Control Methods > EnableButton Method |
EnableButton Method
Sets the enabled state of the button.
TData.EnableButton Index, Enabled
Method applies to TData control and TDataLite control.
Arguments: Index is one of the TDButtonEnum constants, identifying a button of the True DataControl.
Enabled is one of the three TDButtonEnum constants, indicating the enabled state of a button.
Return Value: None
This method allows you to control the enabled state of a button, which is identified by one of the following constants (TDButtonEnum) specified by the Index argument:
0 – tdbButtonFirst |
1 - tdbButtonPrevious |
2 - tdbButtonNext |
3 - tdbButtonLast |
4 - tdbButtonNextPage |
5 - tdbButtonPrevPage |
6 - tdbButtonAdd |
7 - tdbButtonDelete |
8 - tdbButtonUpdate |
9 - tdbButtonCancel |
10 - tdbButtonBookmarks |
11 - tdbButtonFind |
12 - tdbButtonQuery |
The enabled state of the button is one of the following constants (TDButtonEnabledEnum) specified by the Enabled argument:
0 – tdbButtonEnabled |
Unconditionally enables the button. |
1 - tdbButtonDisabled |
Unconditionally disables the button. |
2 - tdbButtonEnabledDefault |
Defers to True DataControl to enable/disable the button according to the current circumstances. For example, the Update button is enabled if a record has been modified. |
By default, if you don't call the EnableButton method from code, all buttons behave as bwButtonEnabledDefault.
For more information, see True DataControl Buttons.
See Also