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

Cursor in ReadOnly mode

1 Answer 131 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
NrupalC
Top achievements
Rank 1
NrupalC asked on 13 Feb 2012, 03:50 PM
Hi,

I would like to achieve this:
  1. Cursor should be of type Cursors.Hand on any area of the RadRichTextBox. (WHY?) The application I am creating requires good visual quality and the cursor jumping between an IBeam and Arrow/Hand is not acceptable.
  2. Should be able to set the Cursor to a value and it must hold the same value at all times.
  3. The setting a custom cursor is required only in the ReadOnly Mode.

Placing a rectangle over RadRichTextBox is not a solution as I will loose the hyperlink feature (Even though I need this only in the read only mode).

I have tried:
  1. Setting the cursor on all elements programmatically (Document, Document.Children and so on...)
  2. Setting the Cursor on all elements by walking down the visual tree (this, I haven't spent much time on but tried it). I wouldn't want to go this way as it takes a performance hit to do this.

Am I missing something or is it possible to get hold of the 'UIInlinesLayer' and set the cursor on each of its children.

Thanks
Nrupal

1 Answer, 1 is accepted

Sort by
0
Alex
Telerik team
answered on 16 Feb 2012, 01:44 PM
Hi Nrupal,

Thank you for the time taken to describe your scenario. Unfortunately in the current version there is no easy way to control how the cursor changes when hovering over different elements inside the RadRichTextBox. However there are a couple things you can try.

First you can change the HyperlinkNavigationMode of the rich text box to Click. This way the cursor over hyperlinks will always be Hand and they will be activated on Click (the default is Ctrl+Click). Actually the HyperlinkNavigationMode property was intended exactly for scenarios when the rich text box is in read-only mode.  

So the following setup:

<telerik:RadRichTextBox Cursor="Hand" IsReadOnly="True" HyperlinkNavigationMode="Click" />

will work quite well when showing documents in flow layout mode.

If you want to achieve the same behavior when the layout mode is paged there is also a workaround but some additional work is required to define a custom UILayer with cursor hand. More information on UILayers can be found here.

Please let us know if this works for you or if you need more help.

All the best,
Alex
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
NrupalC
Top achievements
Rank 1
Answers by
Alex
Telerik team
Share this question
or