Condividi tramite


IVsTextManager2.NavigateToLineAndColumn2 Method

Definition

Finds or creates an appropriate view on the specified buffer and places the selection at the specified location.

public:
 int NavigateToLineAndColumn2(Microsoft::VisualStudio::TextManager::Interop::IVsTextBuffer ^ pBuffer, Guid % guidDocViewType, int iStartRow, int iStartIndex, int iEndRow, int iEndIndex, System::UInt32 grfIncludeViewFrameType);
public int NavigateToLineAndColumn2 (Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer pBuffer, ref Guid guidDocViewType, int iStartRow, int iStartIndex, int iEndRow, int iEndIndex, uint grfIncludeViewFrameType);
abstract member NavigateToLineAndColumn2 : Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer * Guid * int * int * int * int * uint32 -> int
Public Function NavigateToLineAndColumn2 (pBuffer As IVsTextBuffer, ByRef guidDocViewType As Guid, iStartRow As Integer, iStartIndex As Integer, iEndRow As Integer, iEndIndex As Integer, grfIncludeViewFrameType As UInteger) As Integer

Parameters

pBuffer
IVsTextBuffer

[in] Pointer to the IVsTextBuffer interface.

guidDocViewType
Guid

[in] GUID identifying the view. This value should always be LOGVIEWID_TextView.

iStartRow
Int32

[in] Starting line for the selection to locate.

iStartIndex
Int32

[in] Starting index for the selection to locate.

iEndRow
Int32

[in] Ending line for the selection to locate.

iEndIndex
Int32

[in] Ending index for the selection to locate.

grfIncludeViewFrameType
UInt32

[in] View frame type. For more information see _VIEWFRAMETYPE

Returns

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

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsTextManager2::NavigateToLineAndColumn2(  
   [in] IVsTextBuffer* pBuffer,  
   [in] REFGUID guidDocViewType,  
   [in] long iStartRow,  
   [in] CharIndex iStartIndex,  
   [in] long iEndRow,  
   [in] CharIndex iEndIndex,  
   [in] VIEWFRAMETYPE grfIncludeViewFrameType  
);  

To use this method, pass in a pointer to a text buffer and a line/column position in that buffer. The method then locates the buffer, displays a view if the view is not currently active, and then places selection at the specified span of text.

Applies to