Highlighted Syntax

Directive Needed:
System.Text.RegularExpressions;
using System.Runtime.InteropServices;

Other: Timer, RichTextBox

Code:
try
{
LockWindowUpdate(richTextBox1.Handle);
int selPos = richTextBox1.SelectionStart;
foreach (Match keyWordMatch in keyWords.Matches(richTextBox1.Text))
{
richTextBox1.Select(keyWordMatch.Index, keyWordMatch.Length);
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.SelectionStart = selPos;
richTextBox1.SelectionColor = Color.Black;
}
}
finally
{
LockWindowUpdate(IntPtr.Zero);
}


Kill Flashing:
[DllImport("user32.dll")] // import lockwindow to remove flashing
public static extern bool LockWindowUpdate (IntPtr hWndLock);
Wyszukiwarka

Podobne podstrony:
Coolio Geto Highlites
syntax doc
functions old syntax
Syntax lecture3
AVR Syntax
highlighted text
Syntax lecture1
Highlighter Highlight
Syntax lecture7 morphology
syntax
Vorlesung Syntax 5
Syntax
Vorlesung Syntax 6
function highlight string
crystal syntax, sentence structure, complex sentences
language basic syntax comments

więcej podobnych podstron