Information générale
Catégorie:
Codage, syntaxe et commandes
Hi Kevin,
From the VMP help file:
The behavior you describe is "by design", as the Enabled (and Visible) status of each button inheriting from XXFWCTRL.VCX/cmdData is updated each time its Refresh method fires, by calling THISFORM.ActionButtonRefreshLogic(), here:
XXDTES("XXFWCTRL.VCX","THISFORM.ActionButtonRefreshLogic","cmdData","Refresh")
Knowing that, the solution is to put code in the Refresh of the button(s) in question, either:
THIS.Enabled = .f.
* NO callback, permanently disabled
or
IF
* conditionally disabled
THIS.Enabled = .f.
ELSE
DODEFAULT()
ENDIF
If the form in question has a linked toolbar (inheriting from XXFWFRM.VCX/tbrSCADONav), the default behavior is to disable the toolbar.cmdPrint button rather than rendering it invisible. This is so that buttons don't "come and go" from the toolbar, but rather the set of buttons remain constant and just enable/disable. If you need a form button you render invisible to also be rendered invisible on a linked toolbar, see this help topic on that subject.
>I have a cmdDataAction button (xxfwctrl.vcx) on a form, named cmdDelete.
>
>I have tried setting the button's Enabled property to .F., I have tried ThisForm.cmdDelete.Enabled = .F. in the
>Init, Show and Activate.
>
>When I step into the code, the button initially disables, then comes back on later when I resume.
>
>Anyone know how to turn off a button in VMP?
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement