FlowDocument RunFlowDoc = new FlowDocument();
Paragraph Runparagraph = new Paragraph();

RunFlowDoc.Blocks.Add(Runparagraph);
txtRichBox.Document = RunFlowDoc;

Run r = new Run(content);
if (type == 0)
r.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 255));
else if (type == 1)
r.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
else
r.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
Runparagraph.Inlines.Add(r);
Runparagraph.Inlines.Add("\r");
txtRichBox.ScrollToEnd();

//行内追加

Run r = Runparagraph.Inlines.ElementAt(Runparagraph.Inlines.Count - 2) as Run;
r.Text += ">>正在上传";

//加入图片 
BitmapImage bi = new BitmapImage(new Uri(@"F:\image\submit.png")); Image image = new Image(); image.Source = bi; InlineUIContainer container = new InlineUIContainer(image); Paragraph paragraph = new Paragraph(container);

  

  

相关文章:

  • 2021-10-08
  • 2021-05-29
  • 2022-02-20
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-02-05
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-10-28
  • 2021-09-24
  • 2022-12-23
相关资源
相似解决方案