Click here to Skip to main content
Rate this: bad
good
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 20-Feb-13 4:57am
Groulien2.8K
Comments
ali rad at 20-Feb-13 14:23pm
   
Is it possible put part of RichTextBox in WPF XAML here?
nbgangsta at 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>
   
Can you add a screenshot of how it looks?
Josh_T at 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 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)

  Print Answers RSS
0 CPallini 365
1 Sergey Alexandrovich Kryukov 252
2 OriginalGriff 165
3 George Jonsson 159
4 Richard MacCutchan 110
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,860
2 CPallini 5,135
3 George Jonsson 3,559
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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