473,388 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

creating object from string...

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
5 2378
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug | last post by:
I am attempting to create a unit test that can switch between calling a method from the web service I created or calling the component that the web service actually calls. So in my unit test...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
1
by: Dixie | last post by:
I wish to add some fields to an existing table in code. I am using the following code from rkc. CurrentDb.Execute ("ALTER TABLE MyTable ADD MyNewField Text 25") This works , but I need to also set...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
6
by: Simon Verona | last post by:
I would normally use code such as : Dim Customer as new Customer Dim t as new threading.thread(AddressOf Customer.DisplayCustomer) Customer.CustomerId=MyCustomerId t.start Which would create...
4
by: Michael K. Walter | last post by:
I'd like to create a strongly-typed collection of objects that are indexed by a string value (key is a string). I'd also like to allow users to iterate over the collection using a For-each loop...
16
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
4
by: tshad | last post by:
I am trying to set up an Image authorization where you type in the value that is in a picture to log on to our site. I found a program that is supposed to do it, but it doesn't seem to work. ...
0
by: austincolby | last post by:
I am working on creating a SOAP client in Visual Studio 2008 for the first time but am running into a few issues. I added the Web Service reference to the project and am able to see the namespace...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.