In VS05, I have a form that has a standard RichTextBox control in which my
client wants to be able to type an Enter key and have the RichTextBox
respond by inserting a new line instead of either moving to the next control
in the Z order or closing the form. He doesn't want to use Ctrl+Enter. He
wants to use a plain Enter key. Now, back in the Bad Ole Days, there was an
attribute 'WantsReturnKey' that would enable exactly this sort of behaviour
but I do not see that particular attribute available now. What must one do
so that the Enter key is inserted into the RichTextBox instead of being
passed to the default form?

Signature
Richard Lewis Haggard
General: www.Haggard-And-Associates.com
"Have you noticed? Dogs have owners. Cats have staff."
Please come visit here for a couple thousand good giggles!:
www.haggard-and-associates.com/Humor/humor.htm
dbgrick - 26 Jun 2007 19:55 GMT
Set the AcceptsTab property to true on the RichTextBox control.
Rick D.
Contractor
> In VS05, I have a form that has a standard RichTextBox control in which my
> client wants to be able to type an Enter key and have the RichTextBox
[quoted text clipped - 5 lines]
> so that the Enter key is inserted into the RichTextBox instead of being
> passed to the default form?
Richard Lewis Haggard - 26 Jun 2007 23:31 GMT
Thanks. It never occurred to me to look there.
By the way, you'll love this - now my client has filed a bug report saying
that the Tab key no longer shifts focus out of the RichTextBox. Pardon me
while I go find something flat and unyielding against which to repeatedly
apply my forehead with the most speed and force I can muster.

Signature
Richard Lewis Haggard
General: www.Haggard-And-Associates.com
Please come visit here for a couple thousand good giggles!:
www.haggard-and-associates.com/Humor/humor.htm
> Set the AcceptsTab property to true on the RichTextBox control.
>
[quoted text clipped - 15 lines]
>> so that the Enter key is inserted into the RichTextBox instead of being
>> passed to the default form?