RichEditBox as an immediate window

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.
 
R

Ryan Liu

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
 
F

Frans Bouma [C# MVP]

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#)
------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top