For testing purposes, I'm trying to print in the console everything that I
write in a RichTextCtrl. However, it isn't working. Here is the way I wrote
the binding for the RichTextCtrl, called textArea:
However, when I type something, only a blank line is printed in the console,
and nothing appears written in the RichTextCtrl. What am I doing wrong?
Thanks in advance.
For testing purposes, I'm trying to print in the console everything that I
write in a RichTextCtrl. However, it isn't working. Here is the way I wrote
the binding for the RichTextCtrl, called textArea:
However, when I type something, only a blank line is printed in the console,
and nothing appears written in the RichTextCtrl. What am I doing wrong?
Your event handlers are first in line. You get control before anything
else is done. In this case, your handler is called before the RTC has
seen the message, so the text will not have changed. Further, unless
you call event.Skip(), your handler will be the ONLY one called, so the
RTC itself never sees the character.
Also, remember that the RTC might not take any action on a "key down"
message at all. With keystrokes, the control has to choose between "key
down", "key up", and "char", and each one has its pros and cons. It may
be more useful for you to look at EVT_RICHTEXT_CHARACTER.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.