C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

Label Concatination with Formatting in VB.NET


Posted Date: 04 Sep 2008      Posted By: Ankit      Member Level: Gold     Points: 1   Responses: 2



I am facing one issue in vb.net which is related to Label Control

see senerio is some thing like this

Label1.text =""

Label2.Text="Good"

Label3.Text="Morning"

now

Label1.text="I Wish :" & Label2.Text & Label3.Text

Now output I need in Label1 is

I Wish : Good Morning

I need to show "Good" and "Morning" words in different colors.

Label1.text showing correct result but not the colors.

Please help me in this regard.





Responses

Author: vipul    04 Sep 2008Member Level: DiamondRating: 3 out of 53 out of 53 out of 5     Points: 3

hi,
for that you used this way
lbl1.Text = "<font color='" + lbl2.ForeColor.Name.ToString() + "'>" + lbl2.Text.ToString() + "</font> <font color='" + lbl3.ForeColor.Name.ToString() + "'>" + lbl3.Text.ToString() +"</font>";


vipul,
http://dongavipul.blogspot.com

Please Rate This Answer If They Helpful

Thanks & Regards
Patel Vipul



Author: D.Jeya kumar(JK)    04 Sep 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,

Try to use the richtextbox and there you can format the text and change the color size easily.


what ever you want to form you can do it.some samples are added in the site. change the look and feel of the richtextbox like the label and then apply the formating

http://www.functionx.com/vcsharp2003/controls/richtext.htm


http://www.startvbdotnet.com/controls/rtb.aspx



Regards
JK



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : how aspx get loaded in browser?
Previous : how IIS handle session for each user at a time? in asp.net
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use