Compartilhar via


ITextSelection.Select Method

Definition

Overloads

Select(SnapshotSpan, Boolean)

Selects the text in the specified selectionSpan.

Select(VirtualSnapshotPoint, VirtualSnapshotPoint)

Select from the anchor point to the active point.

Select(SnapshotSpan, Boolean)

Selects the text in the specified selectionSpan.

public:
 void Select(Microsoft::VisualStudio::Text::SnapshotSpan selectionSpan, bool isReversed);
void Select(Microsoft::VisualStudio::Text::SnapshotSpan selectionSpan, bool isReversed);
public void Select (Microsoft.VisualStudio.Text.SnapshotSpan selectionSpan, bool isReversed);
abstract member Select : Microsoft.VisualStudio.Text.SnapshotSpan * bool -> unit
Public Sub Select (selectionSpan As SnapshotSpan, isReversed As Boolean)

Parameters

selectionSpan
SnapshotSpan

The SnapshotSpan of text to select in the underlying text buffer.

isReversed
Boolean

true if the selection was made in a reverse direction, otherwise false.

Remarks

In a reversed selection, the active point is Span.Start and the anchor point is Span.End. In a non-reversed selection, the active point is span.end and the anchor point is Span.Start.

Applies to

Select(VirtualSnapshotPoint, VirtualSnapshotPoint)

Select from the anchor point to the active point.

public:
 void Select(Microsoft::VisualStudio::Text::VirtualSnapshotPoint anchorPoint, Microsoft::VisualStudio::Text::VirtualSnapshotPoint activePoint);
public void Select (Microsoft.VisualStudio.Text.VirtualSnapshotPoint anchorPoint, Microsoft.VisualStudio.Text.VirtualSnapshotPoint activePoint);
abstract member Select : Microsoft.VisualStudio.Text.VirtualSnapshotPoint * Microsoft.VisualStudio.Text.VirtualSnapshotPoint -> unit
Public Sub Select (anchorPoint As VirtualSnapshotPoint, activePoint As VirtualSnapshotPoint)

Parameters

anchorPoint
VirtualSnapshotPoint

The anchor point

activePoint
VirtualSnapshotPoint

The active point

Remarks

A reverse selection is created if the active point comes before the anchor point.

The active point normally corresponds to the end of the selection that contains the caret position. If the selection is reversed, then the active point comes before the anchor point.

Applies to