Can we highlight single word of from Text Property (have multiple words)of Label Control

554 views Asked by At

I am Using infragistics Controls in Window Application.

I have put multiple words in Label’s Text Property, now want to highlight single word from Label Text.

2

There are 2 answers

2
alhalama On

The Infragistics UltraFormattedLinkLabel allows you to set the color of the text for a single word:

<font color="red">Red Text</font> <font color="green">Green Text</font> <font color="#0000ff">Blue Text</font>
0
SteveFerg On

Using Infragistics, in your code you can try:

ultraFormattedLinkLabel1.Value = "This is in <b>Bold</b>";

Another way, using a standard rich text box set to readonly and no borders:

richTextBox1.ReadOnly = true;
richTextBox1.BorderStyle = BorderStyle.None;
richTextBox1.Rtf = @"{\rtf1\ansi This is in \b bold\b0.}";