Share via


VsTextViewClass.GetSelection(Int32, Int32, Int32, Int32) Method

Definition

Returns the text span corresponding to the current selection, if there is one.

public:
 virtual int GetSelection([Runtime::InteropServices::Out] int % piAnchorLine, [Runtime::InteropServices::Out] int % piAnchorCol, [Runtime::InteropServices::Out] int % piEndLine, [Runtime::InteropServices::Out] int % piEndCol) = Microsoft::VisualStudio::TextManager::Interop::IVsTextView::GetSelection;
public:
 virtual int GetSelection([Runtime::InteropServices::Out] int % piAnchorLine, [Runtime::InteropServices::Out] int % piAnchorCol, [Runtime::InteropServices::Out] int % piEndLine, [Runtime::InteropServices::Out] int % piEndCol);
 virtual int GetSelection([Runtime::InteropServices::Out] int & piAnchorLine, [Runtime::InteropServices::Out] int & piAnchorCol, [Runtime::InteropServices::Out] int & piEndLine, [Runtime::InteropServices::Out] int & piEndCol);
public virtual int GetSelection (out int piAnchorLine, out int piAnchorCol, out int piEndLine, out int piEndCol);
abstract member GetSelection : int * int * int * int -> int
override this.GetSelection : int * int * int * int -> int
Public Overridable Function GetSelection (ByRef piAnchorLine As Integer, ByRef piAnchorCol As Integer, ByRef piEndLine As Integer, ByRef piEndCol As Integer) As Integer

Parameters

piAnchorLine
Int32

[out] Anchor line position for the selection. Based on user selection, this value is not necessarily the upper line in the selection.

piAnchorCol
Int32

[out] Anchor column position for the selection. Based on user selection, this value is not necessarily the upper, left column position in the selection. Viewcol coordinates may include virtual space.

piEndLine
Int32

[out] End line position for the selection. Based on user selection, this value is not necessarily the lower line in the selection.

piEndCol
Int32

[out] End column position for the selection. Based on user selection, this value is not necessarily the lower, right column position in the selection. Viewcol coordinates may include virtual space.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

Applies to