Version

GetCharacterIndexFromXOffset Method

Returns the zero based index of the character on the line that is closest to the specified X offset.
Syntax
'Declaration
 
Public Function GetCharacterIndexFromXOffset( _
   ByVal xOffset As Double _
) As Integer
public int GetCharacterIndexFromXOffset( 
   double xOffset
)

Parameters

xOffset
The horizontal offset (in pixels) from the beginning of the line at which to look for a character.

Return Value

The zero based index of the character on the line that is closest to the specified X offset.
Remarks

Note: If an X offset is specified that is beyond the last character on the line, the index of the last character on the line is returned.

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