3

テキストを追加する場合

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を作成する方法がわかりませんか? ここに画像の説明を入力してください

4

1 に答える 1

0

2 行 x 3 列のテーブルを作成し、対応するセルに要素を追加できます。境界線を表示したくない場合は\brdrcf1、カラー テーブルの白い色のタグを使用します。rtf テーブルの詳細: RTF でのテーブルの使用

于 2013-10-28T16:12:11.703 に答える