对于附加文本
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?