views:

25

answers:

1

I am switching several TextBoxes out for RichTextBoxes to gain some of the cool features.

I had my TextBoxes configured to AcceptReturn so that the enter key will create a new line, rather than leave the control. The RichTextBox does not seem to have this feature.

Is there a simple way to do this, or do I have to capture all keypresses and handle them individually?

+2  A: 

Note: This issue occurs only when you set the "AcceptButton" property of the form.

Set the RichTextBox.AcceptsTab to true. For some reason this works for both tabs and the enter key. If you only want the enter keys then you will have to write custom code.

Carter
Thanks. It turns out I had that set. I forgot I am handling key presses at the form level to move between controls on enter. I will have to hook all keypresses and check for enter each time to override my own behaviours. Thanks.
CaptnCraig