Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Ok what do you need to see exactly? Here is my full code:</p> <pre><code> [DllImport("user32.dll")] // import lockwindow to remove flashing public static extern bool LockWindowUpdate(IntPtr hWndLock); public void Markup(RichTextBox RTB) { try { int selectionstart = richTextBox1.SelectionStart; Point pos = richTextBox1.Location; richTextBox1.Focus(); int topIndex = richTextBox1.GetCharIndexFromPosition(new Point(1, 1)); //int topIndex = richTextBox1.GetCharIndexFromPosition(point); int bottomIndex = richTextBox1.GetCharIndexFromPosition(new Point(1, richTextBox1.Height - 1)); int topLine = richTextBox1.GetLineFromCharIndex(topIndex); int bottomLine = richTextBox1.GetLineFromCharIndex(bottomIndex); int start = richTextBox1.GetFirstCharIndexFromLine(topLine); int end = richTextBox1.GetFirstCharIndexFromLine(bottomLine); int numLinesDisplayed = (bottomLine - topLine) + 2; richTextBox1.Focus(); richTextBox1.Select(start, end); Regex rex = new Regex("&lt;html&gt;|&lt;/html&gt;|&lt;head.*?&gt;|&lt;/head&gt;|&lt;body.*?&gt;|&lt;/body&gt;|&lt;div.*?&gt;|&lt;/div&gt;|&lt;span.*?&gt;|&lt;/span&gt;|&lt;title.*?&gt;|&lt;/title&gt;|&lt;style.*?&gt;|&lt;/style&gt;|&lt;script.*?&gt;|&lt;/script&gt;|&lt;link.*?/&gt;|&lt;meta.*?/&gt;|&lt;base.*?/&gt;|&lt;center.*?&gt;|&lt;/center&gt;"); foreach (Match m in rex.Matches(richTextBox1.SelectedText)) { richTextBox1.Select(m.Index + start, m.Value.Length); richTextBox1.SelectionColor = Color.Blue; richTextBox1.Select(selectionstart, -1); richTextBox1.SelectionColor = Color.Black; } richTextBox1.DeselectAll(); richTextBox1.SelectionStart = selectionstart; } catch (Exception ex) { MessageBox.Show("Error: " + ex); } } private void richTextBox1_VScroll(object sender, EventArgs e) { try { LockWindowUpdate(richTextBox1.Handle);//Stop flashing Markup(richTextBox1); Elements(richTextBox1); FormsTabels(richTextBox1); Attributes(richTextBox1); Comments(richTextBox1); } finally { LockWindowUpdate(IntPtr.Zero); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload