Freigeben über


IVsTextView.ReplaceTextOnLine Method

Replaces line text.

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

Syntax

'Declaration
Function ReplaceTextOnLine ( _
    iLine As Integer, _
    iStartCol As Integer, _
    iCharsToReplace As Integer, _
    pszNewText As String, _
    iNewLen As Integer _
) As Integer
'Usage
Dim instance As IVsTextView
Dim iLine As Integer
Dim iStartCol As Integer
Dim iCharsToReplace As Integer
Dim pszNewText As String
Dim iNewLen As Integer
Dim returnValue As Integer

returnValue = instance.ReplaceTextOnLine(iLine, _
    iStartCol, iCharsToReplace, pszNewText, _
    iNewLen)
int ReplaceTextOnLine(
    int iLine,
    int iStartCol,
    int iCharsToReplace,
    string pszNewText,
    int iNewLen
)
int ReplaceTextOnLine(
    [InAttribute] int iLine, 
    [InAttribute] int iStartCol, 
    [InAttribute] int iCharsToReplace, 
    [InAttribute] String^ pszNewText, 
    [InAttribute] int iNewLen
)
abstract ReplaceTextOnLine : 
        iLine:int * 
        iStartCol:int * 
        iCharsToReplace:int * 
        pszNewText:string * 
        iNewLen:int -> int 
function ReplaceTextOnLine(
    iLine : int, 
    iStartCol : int, 
    iCharsToReplace : int, 
    pszNewText : String, 
    iNewLen : int
) : int

Parameters

  • iLine
    Type: System.Int32
    [in] Integer containing the line.
  • iStartCol
    Type: System.Int32
    [in] Integer containing the starting column.
  • iCharsToReplace
    Type: System.Int32
    [in] Integer containing the characters to replace.
  • pszNewText
    Type: System.String
    [in] Pointer the new text being passed in.
  • iNewLen
    Type: System.Int32
    [in] Length of the buffer (number of characters) being passed in.

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 IVsTextView::ReplaceTextOnLine(
   [in] long iLine,
   [in] CharIndex iStartCol,
   [in] long iCharsToReplace,
   [in] const WCHAR *pszNewText,
   [in] long iNewLen
);

.NET Framework Security

See Also

Reference

IVsTextView Interface

IVsTextView Members

Microsoft.VisualStudio.TextManager.Interop Namespace