PC Review


Reply
Thread Tools Rate Thread

creating object from string...

 
 
Grisha0
Guest
Posts: n/a
 
      29th Dec 2004
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 ??
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      29th Dec 2004
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" <(E-Mail Removed)>

> 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 ??



 
Reply With Quote
 
Grisha0
Guest
Posts: n/a
 
      29th Dec 2004
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

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" <(E-Mail Removed)>
>
>>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 ??

>
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      29th Dec 2004
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


 
Reply With Quote
 
Grisha0
Guest
Posts: n/a
 
      29th Dec 2004
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
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      29th Dec 2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a performance difference between TextWriter.WriteLine(String)and TextWriteLine(String, array<Object>[])? Author Microsoft C# .NET 3 23rd Jun 2008 07:34 PM
Creating a form object from string name MikeB Microsoft VB .NET 9 19th Nov 2006 06:21 AM
creating an instance of an object(s) from a string representation. Joanne Microsoft Dot NET Compact Framework 0 24th Oct 2004 07:11 PM
Creating an object that can be treated as a string? Oenone Microsoft VB .NET 8 15th Jul 2004 10:06 AM
Cannot create an object of type 'System.String[]' from its string representation 'String[] Array' for the 'Options' property. Hessam Microsoft C# .NET 0 8th Aug 2003 09:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:29 AM.