对于附加文字
private void AddText(string text)
{
string[] str = text.Split(new string[] { ";" },
StringSplitOptions.RemoveEmptyEntries);
if (str.Length == 2)
{
richTextBox1.DeselectAll();
richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont, FontStyle.Bold);
richTextBox1.AppendText(Environment.NewLine + str[0] + ";");
richTextBox1.SelectionFont = new Font(richTextBox1.SelectionFont, FontStyle.Regular);
richTextBox1.AppendText(str[1]);
}
}
对于追加图片
Image image = Image.FromFile("Logo.jpg");
// Put the image on the clipboard
Clipboard.SetImage(image);
//// Paste it into the rich tetx box.
richTextBox1.Paste();
我不知道怎么能这样的形象创造的RichTextBox?
可以创建一个2行×3列表和元素添加到相应的细胞。如果你不希望它的边界出现使用\brdrcf1
标签用白色从颜色表。更多关于RTF表:Using Tables in RTF