A little preface:
I’m new to C# and to application programming in genral.
So I wan’t to write a code editor, nothing special though. I’m trying to achieve the syntax highlighting through RichTextBox.SelectionColor as it has been suggested here, however I find it troublesome that one can actually see how the text is being selected in the textbox and that the screen of the textbox follows the selection (scrolls the text to the current selection).
The project is done via WindowsForms, and I tried:
http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx which obviously is using WPF, but the performance on that is quite poor.
I’d also prefer not to rewrite what I have for WPF.
Believe it or not, but I searched for it and I couldn’t find anything.
So I’m asking: Is there some command or setting to disable this behaviour?
Creating a good performing code editor is quite challenging. Getting the best results usually involves writing a new control from scratch. I suggest using this control if you can by the SharpDevelop team.
http://www.codeproject.com/Articles/30936/Using-ICSharpCode-TextEditor
In your case, there is a way of freezing the updating of the textbox while you change the colour of pieces of text using the windows api function, LockWindowUpdate.