HighTechTalks DotNet Forums  

is it possible to convert obj into textbox - read inside TIA

CSharp microsoft.public.dotnet.languages.csharp


Discuss is it possible to convert obj into textbox - read inside TIA in the CSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
 
Posts: n/a

Default is it possible to convert obj into textbox - read inside TIA - 07-02-2004 , 04:15 PM







is it possible to do this.
object obj;
TextBox tb;

obj="textbox"+strA+strB;
tb=obj;

THANK YOU



Reply With Quote
  #2  
Old   
Les
 
Posts: n/a

Default is it possible to convert obj into textbox - read inside TIA - 07-02-2004 , 06:43 PM






Why not just try it instead of wasting bandwidth?

Quote:
-----Original Message-----

is it possible to do this.
object obj;
TextBox tb;

obj="textbox"+strA+strB;
tb=obj;

THANK YOU


.


Reply With Quote
  #3  
Old   
Nick Malik
 
Posts: n/a

Default Re: is it possible to convert obj into textbox - read inside TIA - 07-03-2004 , 02:30 AM



Are you asking: is it possible to take a string and use it to identify an
object that you want to create, and create that object?
Yes.

Take a look at System.Reflection

--- Nick

<CobraStrikes (AT) al (DOT) com> wrote

Quote:
is it possible to do this.
object obj;
TextBox tb;

obj="textbox"+strA+strB;
tb=obj;

THANK YOU





Reply With Quote
  #4  
Old   
Chua Wen Ching
 
Posts: n/a

Default RE: is it possible to convert obj into textbox - read inside TIA - 07-03-2004 , 10:58 AM



Hi CobraStrikes (AT) al (DOT) com,

I think you need to modify your code a bit.

object obj;
string strA = "Hello ";
string strB = "World";
obj = "textbox" + strA + strB;
textBox1.Text = obj.ToString();

1) You need to have textBox1.Text instead of just textBox1, as you want to make TextBox to display it.

2) You need to cast the object to string.

Correct me if i am wrong. Can i use reflection to achieve it? Thanks.
--
Regards,
Chua Wen Ching


"CobraStrikes (AT) al (DOT) com" wrote:

Quote:
is it possible to do this.
object obj;
TextBox tb;

obj="textbox"+strA+strB;
tb=obj;

THANK YOU




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.