Set RTF text into WPF RichTextBox control

前端 未结 5 1181
一个人的身影
一个人的身影 2021-01-31 08:44

I have this RTF text:

{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Arial;}}
{\\colortbl ;\\red0\\green0\\blue0;\\red255\\green0\         


        
5条回答
  •  有刺的猬
    2021-01-31 09:18

    I wrote a really slick solution by extending the RichTextBox class to allow Binding to an actual rich text file.

    I came across this question/answer but didn't really get what I was looking for, so hopefully what I have learned will help out those who read this in the future.

    Loading a RichTextBox from an RTF file using binding or a RichTextFile control

提交回复
热议问题