views:

4

answers:

0

Hi,

I would like to be able to stop the user from modifying certain portions of text in my WPF RichTextBox. To do this, I am handling the PreviewKeyDown event and setting the Handled property to true so that no further processing takes place.

The problem with my approach is that navigation keys are also disabled. I know that I could detect these navigation keys and not set Handled to true when they are pressed. However, I will need to come up with all of the key combinations that are valid / invalid in this circumstance. Before I do this, are there any built in routines that can tell me if the key that is being pressed will result in a modification of the text?

Your suggestions are very much appreciated.

Alan