Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable/Enable a command button
Message
From
07/12/1999 18:58:50
 
 
To
07/12/1999 18:41:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00300087
Message ID:
00300110
Views:
25
>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.

The way I usually do it is the REFRESH method of the button itself, i.e. THIS.ENABLED=IIF(THISFORM.MyProperty=.T.,.T.,.F.)

Now call MyButton.Refresh when Myproperty changes.

Same thing could be achieved with

LPARAMETERS SetActive
THIS.ENABLED=IIF(SetActiveOnOff,.T.,.F.)

Call with THISFORM.MyButton.Refresh(.T.) or (.F.), as it were.

Hope this did it, write back otherwise.

Peter
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform