【发布时间】:2011-08-24 21:23:18
【问题描述】:
很抱歉为此创建一个新线程。
我有一个富文本框,我用来在富文本框中弹出我的 xml 数据。
我不知道如何超链接某些特定标签,对我来说,我需要在数据中超链接标签。
public void TEST(string message,string originalmessage)
{
txtOriginal.Text = originalmessage;
richTextBox1.Text = message;
this.ShowDialog();
}
这里“消息”将 xml 作为字符串传递。
在此处应用 boby 代码后
public void TEST(string message,string originalmessage)
{
richTextBox1.Text = message;
int startIndex = richTextBox1.Text.IndexOf("<Identifier>");
int endIndex = startIndex + ("<Identifier>").Length - 3;
richTextBox1.Select(startIndex, endIndex);
richTextBox1.SelectionColor = Color.Blue;
this.ShowDialog();
}
【问题讨论】:
-
你确定 RTF 支持这个吗?
标签: c# richtextbox