1

"File Format is not valid"RTFをに追加するとエラーが発生しますrichtextbox

        public void Go()
        {
            rtb.Text = "Activated Partial Thromboplastin Time : Collected: 8/17/2012 9:06:00 AM\n";

            rtb.Select(rtb.TextLength, 0);//sets the selection starting point as the end of this Rtb
            rtb.SelectedRtf = @"{\trowd" +//ERROR thrown here
@"\cellx4000" +
@"\cellx9500" +
@"\intbl Activated Partial Thromboplastin Time\cell" +
@"\intbl 34.8 Seconds\cell" +
@"\row}";
}

trowdRichTextBoxにを追加するにはどうすればよいですか?

4

1 に答える 1

2

rtfコードを挿入するには、完全に独立したrtfドキュメントである必要があります。つまり、テキストの\rtf1{ヘッダーと終了}記号が必要です。

rtb.SelectedRtf = @"{\rtf1\ansi{\trowd" +//ERROR thrown here
@"\cellx4000" +
@"\cellx9500" +
@"\intbl Activated Partial Thromboplastin Time\cell" +
@"\intbl 34.8 Seconds\cell" +
@"\row}}";

}文字列の先頭と末尾の余分な角かっこにも注意してください。

于 2012-12-19T20:06:49.223 に答える