Click to See Complete Forum and Search --> : How can we handle Enter key on richTextBox in WPF?


M-Dayyan
July 4th, 2008, 09:46 AM
Hi friends.
I want to handle Enter key or Space bar key on richTextBox in WPF.
By KeyDawn event I couldn't do it. :ehh:

Can you help me ?

M-Dayyan
July 4th, 2008, 04:00 PM
OK. I found it :

<RichTextBox Name="t" PreviewKeyDown="t_PreviewKeyDown"></RichTextBox>

Arjay
July 4th, 2008, 04:09 PM
Yes. In general any WPF event that has a 'Preview' prefix is fired before the operation has occurred.