Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable/Enable a command button
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00300087
Message ID:
00300105
Views:
26
If you want to disable the button if a form property ( is "A" and enable it if the form property is "Z", then your code would be:
do case
case thisform.MyProp = "A"
   thisform.cmdMyButton.enabled = .F.
case thisform.MyProp = "Z"
   thisform.cmdMyButton.enabled = .T.
otherwise
   wait window "Must put A or Z into the property"
endcase
This code could go into the refresh method of the form, into the assign method of the property (in VFP6), etc. It could even be a form method that is called from several places.

HTH
Barbara

>Simple question, but giving me a hard time. How do I disable or enable a command button using the THIS or THISFORM command. The command button is in a form and I want to have the button enabled only if the user needs to use the button. In other words, how do I reference the enable/disable options using the THISFORM command. Thanks, Mike.
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform