ITextCaret::MoveTo Method (ITextViewLine^, Double)

 

Moves the caret to the best CaretPosition for the specified x-coordinate and text line.

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

CaretPosition MoveTo(
	ITextViewLine^ textLine,
	double xCoordinate
)

Parameters

textLine
Type: Microsoft.VisualStudio.Text.Formatting::ITextViewLine^

The text line that will contain the caret.

xCoordinate
Type: System::Double

The x-coordinate of the caret in the text rendering coordinate system.

Return Value

Type: Microsoft.VisualStudio.Text.Editor::CaretPosition

A CaretPosition that contains the valid values of the caret after the move has occurred.

Exception Condition
ArgumentOutOfRangeException

xCoordinate is NaN.

This is equivalent to calling MoveTo(textLine, xCoordinate, true).

Return to top
Show: