Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable A Visual MaxFrame Button
Message
From
05/03/2008 13:52:01
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01299023
Message ID:
01299035
Views:
12
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?
Previous
Reply
Map
View

Click here to load this message in the networking platform