The C1RichTextBox supports hyperlinks, which provide a standard mechanism for implementing user interactivity. In some cases, you may want to go beyond that and provide additional, custom mouse interactions. For example, you may want to apply some custom formatting or show a context menu when the user clicks an element.
To enable these scenarios, the C1RichTextBox exposes ElementMouse* events and a C1RichTextBox.GetPositionFromPoint method.
If all you need to know is the element that triggered the mouse event, you can get it from the source parameter in the event handler. If you need more detailed information (the specific word that was clicked within the element for example), then you need the C1RichTextBox.GetPositionFromPoint method. C1RichTextBox.GetPositionFromPoint takes a point in client coordinates and returns a C1TextPosition object that expresses the position in document coordinates.
The C1TextPosition object has two main properties: Element and Offset. The Element property represents an element within the document; Offset is a character index (if the element is a C1Run) or the index of the child element at the given point.
In the following section learn how to implement Hit Testing in RichTextBox .NET and .NET Framework versions.