We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use WPF RichTextBox (SfRichTextBoxAdv) control in Windows Forms application?

Platform: WPF |
Control: SfRichTextBoxAdv |
.NET Framework: 3.5

WPF RichTextBox (SfRichTextBoxAdv) control allows you to view, edit, and print rich text contents, and also import and export the Html, Xaml, Text files and Word documents (".doc", ".docx", ".rtf"). If you need to add rich user experience as like Windows Presentation Foundation (WPF) to your existing application is in Windows Forms, then it is more effective to embed one or more feature rich WPF controls to your existing Windows Forms application. You can host the Syncfusion SfRichTextBoxAdv WPF control to your existing Windows Forms application using ElementHost in Windows Forms.

The following sample demonstrates to host Syncfusion SfRichTextBoxAdv WPF control in Windows Forms application.

View sample in GitHub.

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment
Vincent Wendrzyk
Feb 26, 2017

 The sample code was helpful.  Is there some way to implement a paste event handler on the wpf control  in the sample app - to check the paste contents prior to the operation being performed?

In the Form1_Load method, I've tried:

System.Windows.DataObject.AddPastingHandler(RichTextBoxAdv, PasteHandler);


RichTextBoxAdv.AddHandler(System.Windows.DataObject.PastingEvent, new System.Windows.RoutedEventHandler(PasteEventHandler), true);

The corresponding methods were as below, but no break point is ever hit in the handlers. 

        private void PasteEventHandler(object sender, System.Windows.RoutedEventArgs e)
            var x = sender as SfRichTextBoxAdv;


        private void PasteHandler(object sender, System.Windows.DataObjectPastingEventArgs e)
            var x = sender as SfRichTextBoxAdv;

Is there something special I need to do when the wpf control is hosted in winforms?  Or are only exposed events on the wpf control supported?


Vincent Wendrzyk
Feb 27, 2017
Never mind, I'll submit an incident... Reply
Arumuga Perumal S [Syncfusion]
Feb 28, 2017

Hi Vincent,

Currently our SfRichTextBoxAdv control does not have support for Paste event. Please log on to our support website to check for further updates.


Arumuga Perumal S

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile