passing a string as a component name
Posted on 2002-04-15
I have a form with 100 checkboxes and some images on it.
they are named A1,A2,A3,A4,A5,A6 Etc..and B1,B2 ,B3
i declare a type
THackCheckbox = class(TCheckbox);
also declare THackimage = class(TImage)
for instance a string var s is = A4 (which is name of component)
so now i could do
THackCheckbox(A4).SetChecked(True) and it works ok
but i need to do
which both fails miserably with some message about s is not a component name .
i tried various "as component" etc but no luck,is it possible to pass string as component name like this?
im sure ive seen this done before by simonet but cant find relevent q.