Google Gruplar, artık yeni Usenet gönderilerini veya aboneliklerini desteklememektedir. Geçmişteki içerikler görüntülenebilir kalmaya devam edecek.

RichTextBox and font change

98 görüntüleme
İlk okunmamış mesaja atla

Vivien Parlat

okunmadı,
22 Eki 2006 01:05:0022.10.2006
alıcı
Hello,

I'm trying to create a small text editor (to be included in another
project), and I've created two methods to toggle bold/italic/underlined
text styles, in order to have the same behaviour as WordPad has, ie :
if I select a text which has bold and non-bold parts, and click
"Italic", after that I have an italic-bold part and an italic-non-bold
one. This is not the case by default, and some programs I use don't
offer to do this.

My algorithm consists in moving the selection before each character,
isolating parts which have the same characteristic, and then use an
enhanced version of MSDN sample code to add or remove the style.

The point is, this takes time (on an Athlon XP 2200+...). If I have a
long selection, and make it bold, the user sees the cursor while it is
moving (to test "SelectedFont" attribute), and sees also the text
blocks being changed. So am I doing that the right way ? Isn't there a
better way to do it, or a way to disable RichTextBox graphical update
during the internal update ? Kind of a "BeginUpdate/EndUpdate", or
"DisablePaint/Repaint" pair, like for some double-buffer components
(when using OpenGL for example) ?

I use VC#2005, and .net framework 2.

Thanks in advance for any answer.

MikeY

okunmadı,
22 Eki 2006 23:38:1022.10.2006
alıcı
Vivien,

Try this link:
http://www.codeproject.com/cs/miscctrl/richtextboxextended.asp
This isa good place to find examples http://www.codeproject.com

Hope that helps

MikeY

"Vivien Parlat" <poc...@gmail.com> wrote in message
news:1161493500.5...@m73g2000cwd.googlegroups.com...

0 yeni ileti