我有列表字符串和相应的RTF字符串,那么如何使用迭代在 RichTextBox
中追加?
this.PreviewRichText.Text = string.Empty;
for (int x = 0; x < entriesList.Count; x++)
{
this.PreviewRichText.AppendText(entriesList[x].Excerpt);
this.PreviewRichText.Rtf = entriesList[x].ExcerptRtf;
_summarycomment += entriesList[x].ReReviewComment ;
}
1 回答
假设
rtfContents
是您的rtf文件内容的字符串列表,您可以使用以下代码:关键是,在每轮循环中,将选择移动到
RichTextBox
的末尾,然后将SelectedRtf
设置为要追加的内容 .您可以创建这样的方法: