Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another Cheezy Tip of the Week (VFP6)
Message
From
13/07/1998 08:45:37
 
 
To
12/07/1998 21:20:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00116665
Message ID:
00116730
Views:
12
>Since the advent of VFP, most people control the state of their forms through a custom form property. For example, we may have a form property called EditState with valid values of 0(idle),1(editing),2(appending).
>
>So, typically, in the Click() method of an Edit button on a form, you may have similar to the following (but probably more complicated):
>
>THISFORM.EditState=1
>THISFORM.SetAll("Enabled",.T.)
>THISFORM.Refresh()
>
>With VFP6, there is a much simpler way to do this. With the new ASSIGN method, you can add an _Assign to any property, custom or native. So...we would create an EditState_Assign method for our form, with the following code (THIS not THISFORM as its a form method):
>
>LPARAMETERS tNewVal
>THIS.EditState=tNewVal
>THIS.SetAll("Enabled",.T.)
>THIS.Refresh()
>
>
>The Edit button Click() method is reduced to nothing but THISFORM.EditState=1. The EditState_Assign method automatically does the rest, encapsulating the behavior of a state change at the level it belongs.
>
>TTFN!


OOO....excellent! Looks like it's time to do a bit of rework on my foundation.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform