Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get an Edit form?
Message
 
To
27/12/2000 21:21:36
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00457215
Message ID:
00457230
Views:
21
>Hi,
>
>Has someone created a form like the sample client form but with inactive fields until an Edit button is clicked. If so any hints on how to accomplish this would be appreciated.
>
>Regards
>Doug Johnston


I would probably subclass the existing controls and add code to the refresh method that checked to see if the form they are on have a ".lEditMode" property (for lack of a better name) which you'll add to your forms that need this functionality. If .lEditMode is set to True, set the .Enabled property of the control to True, otherwise set it to False. Then add a button to the form that just toggles the form's lEditMode property and does a form refresh. There is already a .lAddMode property, so you'd probably want to check that as well to make sure your controls were enabled when adding new items. You'll also need to figure out how you want to handle saving if they click on the Edit button again after entering some information in the form (maybe disable the Edit button and Enable Save/Cancel buttons when editing). All of this is kind of off the top of my head, at 10pm at night, so YMMV ;-)

Or another approach is to use Kevin's cool pseudo-event code. There was an article in Foxpro Advisor I think about it. It uses the SetAll() method to "raise" an event.

Having said all that, I personally like the implied edit mode that MM normally uses.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform