views:

263

answers:

3

Hello,

first this is no rant although its worth alone to put it on a blog...

When I type very fast - having roughly 260 chars/minute - WPF`s RichTextBox starts swallowing chars and I have to stop writing that fast a => a.IsAnnoying = true;

The same in a VB 5.0 RichTextBox fast as hell.

Why is WPF again so great for? Customer satisfactory ?

Seriously, is there something I can tweak to make RichTextBox better responding?

A: 

Do you have any code-behind code that is handling events from the Rich Text Box ?

I tried typing very quickly random characters in one, and it didn't break a sweat. Chars stopped appearing as soon as I stopped typing, no lag at all.

Timores
NO Codebehind, but I use the RichTextbox as DataGridTemplateColumn maybe thats the problem? Code you see also here:http://pastebin.com/nsLh2Qn7
msfanboy
I used your XAML and a custom class (with and without INotifyPropertyChanged) but could not get any lag.Note: I used VS 2010 RC, i.e. .NET 4
Timores
I use VS2010 RC too with .net 4.0...@Timorescould you try this Project please? You find it in this thread maybe you can fix that bug too :Phttp://stackoverflow.com/questions/2375237/wpf-system-argumentexception-0-is-not-a-visual-or-visual3dlook for the sendpace.com link there is the project file.Thanks :)
msfanboy
http://www.codeproject.com/KB/WPF/BindableWPFRichTextBox.aspxalso very good
msfanboy
A: 

It is likely the way you have the bindings set against the Run in the RichTextBox FlowDocument. As with @Timores I am unable to reproduce laggy behavior with a stock RichTextBox. I've used Shawn Duggan's Two Way DataBinding WPF RichTextBox with some good success.

sixlettervariables
@sixlettervariables + Timores:http://blogs.msdn.com/text/archive/2009/09/01/bindable-run.aspxmy approach is correct.
msfanboy
I'm saying that the binding is perhaps the slow part in your example and you may need to change your strategy. Regardless, I have no lag with your example.
sixlettervariables
but if you have no lag with my example how can the binding be the problem ? Then its probably my computer...
msfanboy
Correct, the combination of how you perform the binding and your machine is what I'm surmising is your source of lag. Shawn's RichTextBox has performed very well for me across numerous machines is why I suggested using it.
sixlettervariables
A: 

I tested my project again on a windows xp sp3 32 bit and there is no delay in the richtextbox typing fast!

Does anyone have here a win 7 64 bit like me? Please test my project again!

msfanboy