Exemplo n.º 1
0
        /// <summary>
        /// Set html syntax color text on the RTF html editor.
        /// </summary>
        private void SetColoredText(string text, bool color)
        {
            var selectionStart = _htmlEditor.CaretPosition;

            _htmlEditor.Text          = color ? HtmlSyntaxHighlighter.Process(text) : text.Replace("\n", "\\par ");
            _htmlEditor.CaretPosition = selectionStart;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Set html syntax color text on the RTF html editor.
        /// </summary>
        private void SetColoredText(string text)
        {
            var selectionStart = _htmlEditor.SelectionStart;

            _htmlEditor.Clear();
            _htmlEditor.Rtf            = HtmlSyntaxHighlighter.Process(text);
            _htmlEditor.SelectionStart = selectionStart;
        }
Exemplo n.º 3
0
 private void HtmlSourceForm_Load(object sender, EventArgs e)
 {
     richTextBox1.Rtf = HtmlSyntaxHighlighter.Process(richTextBox1.Text);
 }