>Greetings All,
>
>Attempting to enable and disable all text boxes in a page frame once the user selects the edit or add button. Here is the code I have in my form method:
>
>DISABLEALL Method:
>
>FOR I = 1 TO THISFORM.CONTROLCOUNT
> IF UPPER(THISFORM.CONTROLS(I).NAME) = [TXT_]
> THISFORM.CONTROLS(I).ENABLED = .F.
> ENDIF
>ENDFOR
>
>But it's not going through those textboxes that are listed throughout the 4 pages of the pageframe. the enableall method is quite naturally the opposite, setting enabled to .T.
>
>How do I set all the controls on the pages of the pageframe?
If all your textboxes are based on the same (or just a few) class(es), use SetAll instead. It drills down.
For example:
This.pgfMyPageFrame.SetAll("Enabled", .F.", "textbox")
Otherwise, you'll need to write code that drills down to do this. Typically, you use a recursive routine to do that. Something like this:
LPARAMETER oContainer
LOCAL oObject
FOR EACH oObject IN oContainer.Objects FOXOBJECT
IF UPPER(oObject.Baseclass) = "TEXTBOX"
oObject.Enabled = .F.
ENDIF
IF PEMSTATUS(oObject, "Objects", 5)
This.DisableAll(oObject)
ENDIF
ENDFOR
RETURN
Tamar