picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.57k stars 325 forks source link

RichTextBox/Wpf - applying colours etc. is very slow #464

Open mennodeij opened 8 years ago

mennodeij commented 8 years ago

Today, I tried to do some colours on a RichTextBox with about 200 lines of XML text, in total about 8000 characters or so, with the objective of syntax colouring for XML. I tried various methods, based on regex or simple string scanning, but applying this to a few hundred XML tags took about 20 seconds. I was hoping to do this real-time while the user is typing :smile:

Apparently, it is a known problem with RichTextBox, which might be solved by using BeginChange() and EndChange() or using Control.DeclareChangeBlock().

http://stackoverflow.com/questions/17852635/slow-formatting-of-richtextbox

cwensley commented 8 years ago

Thanks for reporting! This should be a relatively easy addition, though I'm not sure if there's correlating functionality in other toolkits (or even if they are needed). On those toolkits, these methods could just do nothing if not needed.

mennodeij commented 8 years ago

It may be that other toolkits are not so slow; I'll see if I can test this on Gtk soon.