Partager via


IVsTextView.PositionCaretForEditing Method

Puts the caret in a position suitable for editing a function.

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

Syntax

'Déclaration
Function PositionCaretForEditing ( _
    iLine As Integer, _
    cIndentLevels As Integer _
) As Integer
'Utilisation
Dim instance As IVsTextView
Dim iLine As Integer
Dim cIndentLevels As Integer
Dim returnValue As Integer

returnValue = instance.PositionCaretForEditing(iLine, _
    cIndentLevels)
int PositionCaretForEditing(
    int iLine,
    int cIndentLevels
)
int PositionCaretForEditing(
    [InAttribute] int iLine, 
    [InAttribute] int cIndentLevels
)
abstract PositionCaretForEditing : 
        iLine:int * 
        cIndentLevels:int -> int 
function PositionCaretForEditing(
    iLine : int, 
    cIndentLevels : int
) : int

Parameters

  • iLine
    Type: System.Int32
    [in] Integer containing the line to position the caret (cursor) on.
  • cIndentLevels
    Type: System.Int32
    [in] Count of indent levels.

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::PositionCaretForEditing(
   [in] long iLine,
   [in] long cIndentLevels
);

This method places the caret in a position suitable for editing a function. If there is text on the line, the caret goes to the first non-white space character. Otherwise, this method creates the appropriate number of indentations (cIndentLevels) according to the current language settings and places the caret at this location. No centering is done.

.NET Framework Security

See Also

Reference

IVsTextView Interface

IVsTextView Members

Microsoft.VisualStudio.TextManager.Interop Namespace