Click here to Skip to main content
14,669,657 members
Rate this:
Please Sign up or sign in to vote.
Hello CP,

I'm currently working on an WPF application which uses a RichTextBox. Unfortunately I'm having some difficulties.
The WPF RichTextBox (with default settings, no spellcheck) occasionally lags when I'm typing (or just holding down any key). It gives the appearance of unresponsiveness and that's undesirable.

When I couldn't find a fix, I decided to replace it with the RichTextBox from Windows Forms.
The lag is gone but the text loses its formatting (bold, italic, etc.) when using LoadFile or setting the RTF property.

Does anyone know how to remedy either problem?

I doubt that it's my system but these are the specs(this thing isn't even 6 months old!):
AMD A6-4400M APU with Radeon HD Graphics (2 CPUs), ~2.7GHz
4GB RAM
Windows 8 64-bits (pre-installed)
Posted
Comments
aliwpf 20-Feb-13 14:23pm
   
Is it possible put part of RichTextBox in WPF XAML here?
Groulien 20-Feb-13 14:25pm
   
Even a simple form shows the issue.
It might not show on really powerful computers.
<window x:class="LagTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="LagTest" height="300" width="300">
<grid>
<richtextbox name="Rich" grid.column="0" grid.row="0" horizontalalignment="Stretch" verticalalignment="Stretch"></richtextbox>
</grid>
</window>
Michael Haephrati 20-Feb-13 15:01pm
   
Can you add a screenshot of how it looks?
Josh_T 28-Feb-13 23:03pm
   
I too am having the typing lag issues with RichTextBox. I even created a brand new WPF project with just a plain <richtextbox> control in it and it lags. I even tried buiding it and running directly from the executable, still typing lag.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100