By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,962 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,962 IT Pros & Developers. It's quick & easy.

creating object from string...

P: n/a
Hi,
i've got a little question.
I'd like to create an object for example TextBox
normaly it'd like look like this:
TextBox my_Object = new TextBox();

but i'd like to get the name of the instance from a string.

string name = "my_object_name_from_string";
TextBox name = new TextBox();

any ideas how to do such a thing ? is it possible ??
Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Grisha,

You make me curious, what is the sense of your question.
You can give your textbox an external name setting the "text" property to a
string, however what is the sense giving a textbox an internal name from a
string, which will never be seen by a user.

Just curious, because you must have a reason.

Cor

"Grisha0" <gr*****@o2.pl>
i've got a little question.
I'd like to create an object for example TextBox
normaly it'd like look like this:
TextBox my_Object = new TextBox();

but i'd like to get the name of the instance from a string.

string name = "my_object_name_from_string";
TextBox name = new TextBox();

any ideas how to do such a thing ? is it possible ??

Nov 16 '05 #2

P: n/a
i'm trying to create an interface stored in a database in form of strings.
a client application is connecting to the DB.
Getting information (strings) about interface.
with this information is is creating whole interface :D

so the someobject.name is not enough ... i can do it this way but it
will look stupid and i don't like it :]

i'd like to get a string from db like
'TextBox/my_textbox/100/20'

and with such info create
one object of TextBox class
with usable in further programing name of my_textbox.
using it like my_textbox.text = 'blah blah blah';
and parameters ... width 100
height 20

Cor Ligthert wrote:
Grisha,

You make me curious, what is the sense of your question.
You can give your textbox an external name setting the "text" property to a
string, however what is the sense giving a textbox an internal name from a
string, which will never be seen by a user.

Just curious, because you must have a reason.

Cor

"Grisha0" <gr*****@o2.pl>
i've got a little question.
I'd like to create an object for example TextBox
normaly it'd like look like this:
TextBox my_Object = new TextBox();

but i'd like to get the name of the instance from a string.

string name = "my_object_name_from_string";
TextBox name = new TextBox();

any ideas how to do such a thing ? is it possible ??


Nov 16 '05 #3

P: n/a
Grisha,

With dynamicly creating an array of controls, you keep having early binding,
for that you can use an array too the indexes, by instance an hashtable, in
my opinion much more efficient than trying to create an object directly from
a string.

However just my thought,

Cor
Nov 16 '05 #4

P: n/a
could you give me an example.

Cor Ligthert wrote:
Grisha,

With dynamicly creating an array of controls, you keep having early binding,
for that you can use an array too the indexes, by instance an hashtable, in
my opinion much more efficient than trying to create an object directly from
a string.

However just my thought,

Cor

Nov 16 '05 #5

P: n/a
Grisha,
could you give me an example.


No, I dont have that, and I see no reason to make that.

I am not creating a substitute for ms-access.

Cor
Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.