Partager via


ITextViewLine.GetBufferPositionFromXCoordinate Method (Double, Boolean)

Gets the buffer position of the character whose character bounds contains the given x-coordinate.

Namespace:  Microsoft.VisualStudio.Text.Formatting
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

Syntax

'Declaration
Function GetBufferPositionFromXCoordinate ( _
    xCoordinate As Double, _
    textOnly As Boolean _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> GetBufferPositionFromXCoordinate(
    double xCoordinate,
    bool textOnly
)
Nullable<SnapshotPoint> GetBufferPositionFromXCoordinate(
    double xCoordinate, 
    bool textOnly
)
abstract GetBufferPositionFromXCoordinate : 
        xCoordinate:float * 
        textOnly:bool -> Nullable<SnapshotPoint> 
function GetBufferPositionFromXCoordinate(
    xCoordinate : double, 
    textOnly : boolean
) : Nullable<SnapshotPoint>

Parameters

  • xCoordinate
    Type: Double

    The x-coordinate of the desired character.

  • textOnly
    Type: Boolean

    If true, then this method will return nulla null reference (Nothing in Visual Basic) if xCoordinate is over an adornment.

Return Value

Type: Nullable<SnapshotPoint>
The text buffer-based point of the character at xCoordinate, or nulla null reference (Nothing in Visual Basic) if there is no character at that position.

Remarks

The rightmost edge of a character bound is considered to be contained in its following character. The rightmost edge of the last character's bounds do not map to any character. If textOnly is true and xCoordinate is over an adornment, then the text position associated with the adornment is returned.

.NET Framework Security

See Also

Reference

ITextViewLine Interface

GetBufferPositionFromXCoordinate Overload

Microsoft.VisualStudio.Text.Formatting Namespace