Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making Fields Read only
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00634031
Message ID:
00634137
Views:
27
>Nadya,
>I was looping to first do a test to check if the object has a Readonly property, else I was getting an error.
>Does Setall allow for this ?
>
>Regards,
>
>Gerard

Yes, if you don't specify classes (last parameter). If the property doesn't exist, it just ignores it.
>
>
>>>Hi.
>>>I have a form with 3 pages, Page 1 = Grid and various fields in pages 2 and 3
>>>
>>>I am trying to conditionally prevent access to fields if the grid record is set to Posted. In other words, If the record has been posted, dont allow any fields to be amended, else allow fields to be amended.
>>>
>>>I have set up a loop to set the fields to read only e.g.
>>>For LnFor = 1 to ThisForm.pgfPageFrame1.page2.ControlCount
>>> If Pemstatus(ThisForm.pgfPageFrame1.page2.Controls(lnFor),"Readonly", 5)
>>> ThisForm.pgfPageFrame1.page2.Controls(lnFor).Readonly = .T.
>>> Endif
>>>Endfor
>>>
>>>This works up to a point:
>>>1) Combo boxes are not flagged as read only
>>>2) When I hit a record that has NOT been posted, I will probably have to run through a loop to flag all fields as readable again (except that I have some fields that will always be read only)
>>>
>>>I'm just wondering is there another/better way of doing this ?
>>>
>>>Regards,
>>>
>>>Gerard
>>
>>You can use SetAll method instead of looping. Also ReadOnly doesn't work for comboboxes with "list" style. Try to use enabled property instead...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform