Gary:
>Using CodeMine version 6.1.19, I'm trying (and apparently failing) to disable the Toolbar Delete button in certain circumstances.
You can disable the delete button (or any other state) in the Form.IsEnabled method. The state manager passes the name of the delete method (ie. Delete <s>) to the Form.IsEnabled method. If IsEnabled returns .T., the delete method is allowed and therefore any object hooked to this state will be enabled. If it returns .F., then the object will be disabled.
So, sublcass the IsEnabled method and place the code that determines the "certain circumstances" in which you want the delete button enabled/disabled. Your custom code simply returns .T. or .F. to toggle the state.
Don't forget to issue a dodefault() so that the enabled state is processed for all methods other than the delete method. So ...
Form.IsEnabled
LPARAMETER cMethod, cWorkarea
IF m.cMethod == 'Delete' && Remember the parameter is passed in Proper case.
If ... (I want the delete button enabled.)
Return .T.
Else
* I don't want the delete button enabled.
Return .F.
Endif
* Default processing
RETURN DODEFAULT(m.cMethod, m.cWorkarea)
Hope this helps.
-=Gary