Reputation: 681
So I know that there is a way do do the Flow Document in WPF. I'm looking for a way to do a FlowDocument in WinForm. Below is a snippet of code that I'm trying to get to work in WinForm and I know it works in WPF. Trying to port.
range = new TextRange(rtbPreview.Document.ContentStart, rtbPreview.Document.ContentEnd);
fstream = new FileStream(_fileName, FileMode.OpenOrCreate);
range.Load(fstream, DataFormats.XamlPackage);
fstream.Close()
It errors out on the rtbPreview.Document
section. Target Framework: .NET 4.5
Upvotes: 1
Views: 1364
Reputation: 1421
You can host a WPF control including XAML RichTextBox
in your WinForms form according to this.
System.Xaml
to "Reference"RichTextBox
on the container. Form
designerUpvotes: 1