Página 1 de 1

All controls of a form

Publicado: Mar Ago 14, 2007 9:08 am
por Guest
Hi,
is it possible to create an array with all controls that have been created
in a form?
Best regards, Timm.

All controls of a form

Publicado: Mar Ago 14, 2007 11:07 am
por jfgimenez
Timm,
> is it possible to create an array with all controls that have been created
> in a form?
FUNCTION GetAllControls( oParent )
LOCAL aControls := {}
GetControls( oParent, aControls )
RETURN aControls
STATIC PROCEDURE GetControls( oParent, aControls )
LOCAL oCtl
IF oParent:IsKindOf( "TWinControl" )
FOR EACH oCtl IN oParent:aControls
AAdd( aControls, oCtl )
GetControls( oCtl, aControls )
NEXT
ENDIF
RETURN
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

All controls of a form

Publicado: Mar Ago 14, 2007 11:07 am
por jfgimenez
Timm,
> is it possible to create an array with all controls that have been created
> in a form?
FUNCTION GetAllControls( oParent )
LOCAL aControls := {}
GetControls( oParent, aControls )
RETURN aControls
STATIC PROCEDURE GetControls( oParent, aControls )
LOCAL oCtl
IF oParent:IsKindOf( "TWinControl" )
FOR EACH oCtl IN oParent:aControls
AAdd( aControls, oCtl )
GetControls( oCtl, aControls )
NEXT
ENDIF
RETURN
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info

All controls of a form

Publicado: Mar Ago 14, 2007 6:27 pm
por Guest
Jose,
works great, many thanks!
Best regards, Timm.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:[email=46c170ed@ozsrv2.ozlan.local...]46c170ed@ozsrv2.ozlan.local...[/email]
> Timm,
>
>> is it possible to create an array with all controls that have been
>> created in a form?
>
> FUNCTION GetAllControls( oParent )
> LOCAL aControls := {}
> GetControls( oParent, aControls )
> RETURN aControls
>
> STATIC PROCEDURE GetControls( oParent, aControls )
> LOCAL oCtl
> IF oParent:IsKindOf( "TWinControl" )
> FOR EACH oCtl IN oParent:aControls
> AAdd( aControls, oCtl )
> GetControls( oCtl, aControls )
> NEXT
> ENDIF
> RETURN
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
> http://www.xailer.info
>

All controls of a form

Publicado: Mar Ago 14, 2007 6:27 pm
por Guest
Jose,
works great, many thanks!
Best regards, Timm.
"Jose F. Gimenez" <jfgimenez@wanadoo.es> schrieb im Newsbeitrag
news:[email=46c170ed@ozsrv2.ozlan.local...]46c170ed@ozsrv2.ozlan.local...[/email]
> Timm,
>
>> is it possible to create an array with all controls that have been
>> created in a form?
>
> FUNCTION GetAllControls( oParent )
> LOCAL aControls := {}
> GetControls( oParent, aControls )
> RETURN aControls
>
> STATIC PROCEDURE GetControls( oParent, aControls )
> LOCAL oCtl
> IF oParent:IsKindOf( "TWinControl" )
> FOR EACH oCtl IN oParent:aControls
> AAdd( aControls, oCtl )
> GetControls( oCtl, aControls )
> NEXT
> ENDIF
> RETURN
>
> --
> Regards,
>
> Jose F. Gimenez
> http://www.xailer.com
> http://www.xailer.info
>