Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
140755 | Nov 5,2018 04:50 PM UTC | Nov 7,2018 12:12 PM UTC | WPF | 3 |
![]() |
Tags: SfRichTextBoxAdv |
SfRichTextBoxAdv richTextBoxAdv = new SfRichTextBoxAdv();
//Build RTF content for your formatted text.
string formattedText = @"{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\b\ltrch Hello world}\li0\ri0\sa0\sb0\fi0\ql\par}{\f2 {\i\ltrch Welcome to WPF}\li0\ri0\sa0\sb0\fi0\ql\par}}}";
//Set RTF text in clipboard with format.
Clipboard.SetText(formattedText, TextDataFormat.Rtf);
Button insertText = new Button();
//Invoke the paste command.
insertText.Click += (object sender, RoutedEventArgs e) => { SfRichTextBoxAdv.PasteCommand.Execute(null, richTextBoxAdv); };
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.