>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:
thisform.SetAll("Enabled", .t., "Textbox")
Another way is to set some logical property, like form.lEditMode
thisform.lEditMode = .t.
thisform.refresh()
and check the state of the property in yourcontrol.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