Sergey,
You have two choices here in general. The first is to place each
reference to a control in a Hashtable (or a Dictionary if you are using .NET
2.0) and then key it on whatever you wish (the name, a number, etc, etc).
The other option is to use reflection on the class containing the
control, and then expose that (however, the class doesn't always have to
have a class level reference to the control for it to be visible).
Of course, in environments like ASP.NET, you might be provided with a
mechanism such as this already.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Sergey Atun" <s@s.com> wrote in message
news:uW**************@TK2MSFTNGP09.phx.gbl...
Hi,
How can I access object with a name like this:
string ObjectName = "TextBox1";
TextBox(ObjectName).Text = "bla bla bla"
Thanks.