ITextCaret::MoveTo Method (ITextViewLine^, Double, Boolean)
Visual Studio 2015
Moves the caret to the best CaretPosition for the specified x-coordinate and text line.
Assembly: Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
CaretPosition MoveTo( ITextViewLine^ textLine, double xCoordinate, bool captureHorizontalPosition )
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.
- captureHorizontalPosition
-
Type:
System::Boolean
true if the caret should capture its horizontal position for subsequent moves up or down, false if the caret should retain its previously-captured horizontal position.
Return Value
Type: Microsoft.VisualStudio.Text.Editor::CaretPositionA CaretPosition that contains the valid values of the caret after the move has occurred.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | xCoordinate is NaN. |
This method takes care of UTF-16 surrogate pairs and combining character sequences.
Show: