次の方法で共有


IVsTextManager.NavigateToPosition Method

Finds or creates an appropriate view on the specified buffer and puts the selection on the specified linear position.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'宣言
Function NavigateToPosition ( _
    pBuffer As IVsTextBuffer, _
    ByRef guidDocViewType As Guid, _
    iPos As Integer, _
    iLen As Integer _
) As Integer
'使用
Dim instance As IVsTextManager
Dim pBuffer As IVsTextBuffer
Dim guidDocViewType As Guid
Dim iPos As Integer
Dim iLen As Integer
Dim returnValue As Integer

returnValue = instance.NavigateToPosition(pBuffer, _
    guidDocViewType, iPos, iLen)
int NavigateToPosition(
    IVsTextBuffer pBuffer,
    ref Guid guidDocViewType,
    int iPos,
    int iLen
)
int NavigateToPosition(
    [InAttribute] IVsTextBuffer^ pBuffer, 
    [InAttribute] Guid% guidDocViewType, 
    [InAttribute] int iPos, 
    [InAttribute] int iLen
)
function NavigateToPosition(
    pBuffer : IVsTextBuffer, 
    guidDocViewType : Guid, 
    iPos : int, 
    iLen : int
) : int

Parameters

  • iPos
    Type: System.Int32

    [in] Linear position in buffer on which to put the caret.

Return Value

Type: System.Int32

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

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsTextManager::NavigateToPosition(
   [in] IVsTextBuffer * pBuffer,
   [in] REFGUID guidDocViewType,
   [in] long iPos,
   [in] long iLen
);

This method is the same as NavigateToLineAndColumn, except that it uses one-dimensional, positional coordinates.

Permissions

See Also

Reference

IVsTextManager Interface

IVsTextManager Members

Microsoft.VisualStudio.TextManager.Interop Namespace