TextSelection.MoveToDisplayColumn 方法

将活动点移动到指示的显示列。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Sub MoveToDisplayColumn ( _
    Line As Integer, _
    Column As Integer, _
    Extend As Boolean _
)
void MoveToDisplayColumn(
    int Line,
    int Column,
    bool Extend
)
void MoveToDisplayColumn(
    [InAttribute] int Line, 
    [InAttribute] int Column, 
    [InAttribute] bool Extend
)
abstract MoveToDisplayColumn : 
        Line:int * 
        Column:int * 
        Extend:bool -> unit
function MoveToDisplayColumn(
    Line : int, 
    Column : int, 
    Extend : boolean
)

参数

  • Line
    类型:Int32

    必需。 一个 vsGoToLineOptions 常数,表示距缓冲区起始位置的行偏移量,从 1 开始。

  • Column
    类型:Int32

    必需。 表示是一个新的列位置的虚拟显示列,从 1 开始。

  • Extend
    类型:Boolean

    可选。 确定所移动的文本是否折叠。 默认值为 false。

备注

MoveToDisplayColumn 将文本选择移至指定的行和列。 如果列偏移在行的制表符中间,则活动点移到紧挨在制表符前面的位置。

如果 Line 或 Column 的值为零,则活动点保持在当前行号和/或列号的位置。

示例

Sub MoveToDisplayColumnExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   ' Go to first line in document and select it.
   objSel.GotoLine(1, True)
   ' Move to various lines and offsets (character columns).
   objSel.MoveToAbsoluteOffset(3, True)
   objSel.MoveToDisplayColumn(3, True)
End Sub

.NET Framework 安全性

请参阅

参考

TextSelection 接口

EnvDTE 命名空间