I am working on a small project and I need to reference controls that they are created during runtime. The name of the control is saved in a variable, is there a way to refer to this control.

Example

dim A as string
dim B as textbox

somewhere in code A="SOMENAME", this name is created randomly

B= new textbox
B.name=A

pnlcontrols.controls.add(B)

Later in the program I need to refer to the SOMENAME.text
but the value SOMENAME is held in the variable A, A.text is not possible. Is there a way to do this. I need to replace A with the value of A at runtime.


Thanks