FWIW, you don't have to use macro expansion in VFP for this either. Look at the SetAll() method, and the Controls[] collection. You can also use eval()
for i = 1 to 10
lcName = "thisform.text" + alltrim( str(i) )
loObject = eval( lcName )
with loObject
.Enabled = .t.
endwith
endfor
I don't use VB but I do think it has a Controls[] collection like VFP does.
>I am a VFP developer and need to do something in VB. In VFP, doing the following is routine business:
>
>for i = 1 to 10
> cBox = 'text' + alltrim(str(i))
> thisform.&cBox..enabled = .t.
>next
>
>The ampersand is Macro Substitution.
>
>How to do it in VB??
>
>I posted this in the VB Forum but got negative replies. Everybody said could not be done in VB.