Change a string of a string to bold

2

I'm doing a program in VB and I have a text string, which I add to a RichTextBox , but I want to add some things to it.

What I want to achieve is that the text be like the following:

" More than most of the measurements that were taken from the dome's pressure exceed the limit with a 80% of the total."

I do not know if it is possible to achieve that.

    
asked by Daniel Peña 21.06.2017 в 02:15
source

1 answer

5

It is possible, use the property RTF to convert the text to bold :

    Dim sb = New System.Text.StringBuilder()
    sb.Append("{\rtf1\ansi")
    sb.Append("\b Más de la mayoría de las mediciones\b0  que se realizaron de la presión del domo sobrepasan el límite con un \b 80%\b0  del total.")
    sb.Append(" \par}")


    RichTextBox1.Rtf = sb.ToString()

It is important to correctly place the containers, \b and \b0 , both are added a space:

\b Palabra en negrita\b0 

Using this method you would display "bold" text within your RichTextBox :

    
answered by 21.06.2017 / 05:43
source