Hi Tomasz Jagusz,
Thank you for contacting Syncfusion support.
At present, there is no Syncfusion rich text editor component available in Windows Forms. However you can use our WPF SfRichTextBoxAdv control in your windows forms application using ElementHost. The 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"). for further information about SfRichTextBoxAdv control, kindly refer the below UG link,
UG link: https://help.syncfusion.com/wpf/sfrichtextboxadv/getting-started
We have already published an KB article to show how to use SfRichTextBoxAdv in Windows Forms application. Please refer the KB article from following link,
https://www.syncfusion.com/kb/5909/how-to-use-wpf-sfrichtextboxadv-control-in-windows-forms-application
You can also export the SfRichTextBoxAdv content as Html text and send the html text as mail. Please refer the following KB links for the same.,
https://www.syncfusion.com/kb/5415/how-to-implement-htmltext-property-for-sfrichtextboxadv-control
https://www.syncfusion.com/kb/6303/how-to-create-mail-messages-using-sfrichtextboxadv-control
We have also prepared the sample to demonstrate your requirements and attached in the following link.
Sample link:
Sample.zip.
Try running sample and let us know if this helps you.
Regards,
Venkatesan M.
|
private void Button_Click(object sender, RoutedEventArgs e)
{
try
{
if (Clipboard.ContainsImage())
{
//Gets image from clipboard.
BitmapSource bmp = Clipboard.GetImage();
Image img = new Image();
img.Source = bmp;
// Insert image in SfRichTextBoxAdv control.
richTextBoxAdv.Selection.InsertPicture(img);
}
}
catch
{ }
|
// Hooks the image node visited event to process the images of the documents on html export. richTextBoxAdv.HtmlImportExportSettings.ImageNodeVisited += HtmlImportExportSettings_ImageNodeVisited; // Event implementation. private void HtmlImportExportSettings_ImageNodeVisited(object obj,ImageNodeVisitedEventArgs args) { if (args.Stream != null) { // You can process this stream to save it in local file system or upload it online server. MemoryStream stream = new MemoryStream(); // Save the image strea to new image file. args.Stream.CopyTo(stream); stream.Position = 0; // Todo: Process the stream, Upload it to online. // Get the online link. // Set the new image web url path as source.This url path will be written in exported HTML. Example "http://www.website.com/image1.jpg". The images in the html body only can be viewed in online. Since, the images are online images. . args.Source = "http://www.website.com/image1.jpg"; // Dispose stream. stream.Dispose(); } |