RichEditBox as an immediate window

  • Thread starter Thread starter Udi
  • Start date Start date
U

Udi

Hi,
How do I make sure that any character that is typed into my RichEditBox
will be appanded to the Text?

(I'm using the RichEdit as a console window. I'd like to allow the user
selecting any part of the Text he likes, but when typing new chars,
always add them on a new last line (-at the end of the Text) )
Thanks,
Udi.
 
Have you tried to jump the cursor to the end or RichTextBox in the keydown
event?

You can jump the cursor to the end or RichTextBox by call
Select(textBox.Text.Length, 0 )), maybe Length -1, you can try.

HTH
Ryan
 
Udi said:
Hi,
How do I make sure that any character that is typed into my
RichEditBox will be appanded to the Text?

(I'm using the RichEdit as a console window. I'd like to allow the
user selecting any part of the Text he likes, but when typing new
chars, always add them on a new last line (-at the end of the Text) )
Thanks,
Udi.

As soon as you get a key down event, store the original selection,
make the end of the text the actual selection, append the character,
and restore the selection.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Back
Top