I would like to make a line of text in my multicolor richtextbox. I tried various implementations provided on the Internet and read on SelectedText and other topics, but it seems that it cannot make it work as I would like.
That's what i still have
RichTextBox1.Text = "This is black "
RichTextBox1.SelectionFont = New Font("Microsoft Sans Serif", 8.25, FontStyle.Bold)
RichTextBox1.SelectionColor = Color.Green
RichTextBox1.SelectedText = "[BOLD GREEN]"
RichTextBox1.Text = RichTextBox1.Text + " black again"
The colors I want are indicated as text. What happens: the whole line turns green, "[BOLD GREEN]" appears at the beginning of the text field instead of the built-in one.
I want him to read this: "it's black," like black. "[BOLD GREEN]" as green and "black again" as black.
source
share