Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            var rtb = new C1.WPF.RichTextBox.C1RichTextBox();

            rtb.ClipboardPasting += rtb_ClipboardPasting;
            this.Content          = rtb;

            rtb.Html = @"
<p>
    When you copy lists from Microsoft Word to the clipboard, it creates
    a custom HTML document that contains text formatted to look like 
    lists, but without list semantics (ol/ul/li tags).</p>
<p>
    If you paste this custom HTML document into a <b>C1RichTextBox</b>,
    or into any HTML editor, the lists will look correct, but you won't
    be able to insert or append items to the list as you would expect.</p>
<p>
    This sample handles the <b>ClipboardPasting</b> event to inspect the 
    content of the clipboard and to replace Word's custom lists with actual
    HTML lists. When this modified content is pasted into the editor, you 
    get lists that are semantically correct and can be edited as lists.</p>
<p>
    For example, copy a list from Word, paste it here, and then try inserting
    some new items into the list.</p>";
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            var rtb = new C1.WPF.RichTextBox.C1RichTextBox();
            rtb.ClipboardPasting += rtb_ClipboardPasting;
            this.Content = rtb;

            rtb.Html = @"
            <p>
            When you copy lists from Microsoft Word to the clipboard, it creates
            a custom HTML document that contains text formatted to look like
            lists, but without list semantics (ol/ul/li tags).</p>
            <p>
            If you paste this custom HTML document into a <b>C1RichTextBox</b>,
            or into any HTML editor, the lists will look correct, but you won't
            be able to insert or append items to the list as you would expect.</p>
            <p>
            This sample handles the <b>ClipboardPasting</b> event to inspect the
            content of the clipboard and to replace Word's custom lists with actual
            HTML lists. When this modified content is pasted into the editor, you
            get lists that are semantically correct and can be edited as lists.</p>
            <p>
            For example, copy a list from Word, paste it here, and then try inserting
            some new items into the list.</p>";
        }