Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
var z6 = dtTree.Rows[0]["Addres"].ToString();

i want that value z6 were bold and red. How do it?
Posted
Updated 30-Dec-11 8:06am
v2

1 solution

String is simply just a bunch of characters, no color, no font, nothing extra. So you cannot change the font of the string. What you should do is to define the desired properties of the text for example in a control, if you're using a control to show the text.
 
Share this answer
 
Comments
[no name] 30-Dec-11 14:07pm    
i use textbox. But this values is 6. I need that only z6 value were red and bold.
Wendelius 30-Dec-11 14:15pm    
So you should change the font of the text box to red and bold. If you mean that only a part of the text in a single text box should be red and bold, then you could use RichTextBox[^]
Joshi, Rushikesh 30-Dec-11 14:45pm    
Please provide more details, where you want to display Red Bold text, is it a Win form Text box or Web Text Box.

As suggest by Mika, simply you can change property of Text box for your desirable format.

Thanks
Rushi
Sergey Alexandrovich Kryukov 30-Dec-11 22:30pm    
Yes of course, my 5. I appreciate your reasonable attempt to explain such a thing to someone so confused and resisting understanding so much. This is really difficult. :-)
--SA
Wendelius 31-Dec-11 3:41am    
Thank you SA :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900