0

I want to make bold specific line or string in a rich text box.

For Example:

string str = "Hello World";
string str1="Hello Everyone";

richtextbox1.text = str+str1 ;

Here i want "Hello world " in bold case, while "Hello Everyone" in regular case.

There is lot of code to make entire textbox bold.

richtextbox1.Rtf is not working in for each loop as it's not giving bold text.

Failed Scientist
  • 1,977
  • 3
  • 29
  • 48

1 Answers1

1

Formatting Characters in Bold in a RichTextBox Control (Visual C#)

You can use Rtf property

richTextBox1.Rtf = @"{\rtf1\ansi \b" + str + "\b0" + str1 + "}";
mybirthname
  • 17,949
  • 3
  • 31
  • 55