Version

GetPositionFromPoint Method

Returns the document offset that represents the nearest valid text insertion location relative to the supplied point.
Syntax
'Declaration
 
Public Function GetPositionFromPoint( _
   ByVal point As Point, _
   ByVal snapToText As Boolean _
) As Nullable(Of Integer)
public Nullable<int> GetPositionFromPoint( 
   Point point,
   bool snapToText
)

Parameters

point
The point (relative to the XamRichTextEditor control) that should be tested to find the nearest text insertion location.
snapToText
If true, this method always returns a document offset regardless of whether or not the specified point is inside a character's bounding box. If false, the method returns null when the specified point does not fall within any character bounding box.

Return Value

The offset within the document of the text insertion location closest to the specified point or null if the nearest text insertion location could not be determined.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also