我可以在 C# 中创建一个快速彩色文本框并轻松地向其中添加文本:
FastColoredTextBox tb = new FastColoredTextBox();
this.Controls.Add(tb);
tb.Location = new Point(10, 10);
tb.Visible = true;
tb.Text = "This is some text to display in the FCTB.";
我不明白如何将该文本的一个单词更改为不同的颜色。
我不想通过语法来识别单词,我的应用程序更像是一个文字处理器,用户希望用颜色来强调一个单词。
例如,如何将上述代码段中的单词“some”更改为绿色而不是黑色?
谢谢