>Here is a more compact code that doesn't require adding new class to your project
>
>****************
>with Thisform
> for lnThisControl = 1 to .controlcount
> if .controls[lnThisControl].controlsource='X'
> .controls[lnThisControl].backcolor=255,255,0
> endif
> endfor
>endwith
>****************
You are right, it might do the job :-)
But if I am not mistaken, this will not scan trough nested containers but only first 'level' of controls. At least this was the case until VFP6. Maybe something changed with VFP7.
Solution I hv given is generic and can be used for any purpose
and applies to any containership composition.
I am using it as regular part of my framework for validation,
and in many other cases for other purposes.
Main advantage is that if guy tmrw decide to add some container on the form this way he would not hv to change anything.