Udostępnij za pośrednictwem


TextSelection.MoveToDisplayColumn Method

Moves the active point to the indicated display column.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
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
)

Parameters

  • Line
    Type: System.Int32
    Required. A vsGoToLineOptions constant representing the line offset, starting at one, from the beginning of the buffer.
  • Column
    Type: System.Int32
    Required. Represents the virtual display column, starting at one, that is the new column location.
  • Extend
    Type: System.Boolean
    Optional. Determines whether the moved text is collapsed or not. The default is false.

Remarks

MoveToDisplayColumn moves the selected text to the specified line and column. If the column offset is in the middle of a tab character in the line, the active point is moved to the position immediately preceding the tab.

If the values of Line or Column are zero, then the active point remains at the current line number and/or column number.

Examples

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 Security

See Also

Reference

TextSelection Interface

EnvDTE Namespace