Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command Buttons and enabling fields
Message
 
To
08/03/2002 10:19:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00630191
Message ID:
00630213
Views:
25
>Would appreciate someone to point me where I could get information on creating command buttons. I am still a newbie at VFP and doing well copying routines from other projects but now trying to create my own form.
>
>I have created a simple form with fields from a table and want to edit existing records and add new records. I have noticed that a sample form I have seen will not allow any field to be modified unless the edit button or add button is pressed. I realize that individual fields have the enable function but how does one get all the fields enabled or disabled based on a command button?

Typically you can do it like this:
* editbutton.click()
thisform.SetAll("Enabled", .t., "Textbox") && or set to .F. to disable them.
Another way is to set some logical property, like form.lEditMode
* editbutton.click()
thisform.lEditMode = .t.
thisform.refresh()
and check the state of the property in yourcontrol.Refresh()
* somecontrol.Refresh()
this.enabled = thisform.lEditMode
Typically this code should go into .Refresh() of your control(s) class so it will be inherited by all instances.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform