IEditorOperations.MoveCaret 方法

将脱字号移至给定行在特定偏移量。

命名空间:  Microsoft.VisualStudio.Text.Operations
程序集:  Microsoft.VisualStudio.Text.UI(在 Microsoft.VisualStudio.Text.UI.dll 中)

语法

声明
Sub MoveCaret ( _
    textLine As ITextViewLine, _
    horizontalOffset As Double, _
    extendSelection As Boolean _
)
void MoveCaret(
    ITextViewLine textLine,
    double horizontalOffset,
    bool extendSelection
)
void MoveCaret(
    ITextViewLine^ textLine, 
    double horizontalOffset, 
    bool extendSelection
)
abstract MoveCaret : 
        textLine:ITextViewLine * 
        horizontalOffset:float * 
        extendSelection:bool -> unit
function MoveCaret(
    textLine : ITextViewLine, 
    horizontalOffset : double, 
    extendSelection : boolean
)

参数

  • horizontalOffset
    类型:Double

    脱字号要移至的给定 textLine 中的水平位置。

  • extendSelection
    类型:Boolean

    如果为 true,则移动脱字号时扩展所选内容;如果为 false,则不扩展所选内容。

异常

异常 条件
ArgumentNullException

textLine 为 nullnull 引用(在 Visual Basic 中为 Nothing)。

.NET Framework 安全性

请参阅

参考

IEditorOperations 接口

Microsoft.VisualStudio.Text.Operations 命名空间