Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I cast a string into an Object
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00832051
Message ID:
00834076
Views:
19
>I want to cast
>
>"label" + Convert.ToString(i)
>
>into a System.Windows.Forms.Label so that I can use
>
>MessageBox.Show(x.Text);
>
>How can I do that?

Why do you want to cast it into a label for the message box?

Can't you just use:
MessageBox.Show(new String("label" + Convert.ToString(i)));

Or do you have other reasons.

Either way, if you want it to be a label, just create a Label object and set the text property to the string value.
Brian Seekford
Seekford Solutions, Inc.
http://www.SeekfordSolutions.com
Internet ActiveX Controls and .NET Class Libraries.
SMTP/S FTP POP3/S HTTP/S SNTP MIME PING WHOIS TRACEROUTE NNTP DNS MX
Base64, UUEncode, yEnc, MD5, SHA1, URL, Quoted-Printable.
Resizer and Tooltips
Email Verification and more. Check us out!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform