This is a migrated thread and some comments may be shown as answers.

Keyboard focus

1 Answer 192 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 04 Apr 2012, 02:10 PM
I would like to disable Keyboard focus for the RichTextBox.
My RichTextBox is acting more like a viewer, with possibility to select text but not edit.
When I use snoop to check te keyboard focus on my application, I see Keyboard.FocusedElement = Caret
I'm experiencing difficulties disabling this focus.

When I execute UIElement.MoveFocus(new TraversalRequest(FocusNavigationDirection.Up)) I can't either move the focus

1 Answer, 1 is accepted

Sort by
0
Andrew
Telerik team
answered on 06 Apr 2012, 01:28 PM
Hello Vincent,

The only way to disable keyboard focus is to disable all interactions with the editor by setting the property of RadRichTextBox IsEnabled="False". However, this will also disable selection.

Depending on your scenario, you can try using the IsReadOnly property of RadRichTextBox. When set to True, it will disable editing of RadRichTextBox, but you will be able to select text. You can also set IsFocusable="False" to prevent the rich text box from being focused on pressing the Tab key.

Greetings,
Andrew
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Vincent
Top achievements
Rank 1
Answers by
Andrew
Telerik team
Share this question
or