This documentation is archived and is not being maintained.

MoveToDisplayColumn Method

Visual Studio .NET 2003

Moves the active point to the indicated display column.

[Visual Basic .NET]
Public Sub MoveToDisplayColumn( _
   ByVal Line As Integer, _
   ByVal Column As Integer, _
   Optional ByVal Extend As Boolean = False _
[Visual Basic 6]
Sub MoveToDisplayColumn( _
   ByVal Line As Long, _
   ByVal Column As Long, _
   Optional ByVal Extend As Boolean = False _
HRESULT __stdcall MoveToDisplayColumn(
   long Line,
   long Column,
public void MoveToDisplayColumn(
   int Line,
   int Column,
   bool Extend
[JScript .NET]
public function MoveToDisplayColumn(
   Line : int,
   Column : int,
   Extend : Boolean


Required. A vsGotoLineOptions constant representing the line offset, starting at one, from the beginning of the buffer.
Required. Represents the virtual display column, starting at one, that is the new column location.
Optional. Determines whether the moved text is collapsed or not. The default is False.


Moves the selected text to the specified line and column. MoveToDisplayColumn accepts the column value as though the editor were in virtual space mode. 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.


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

See Also

Applies To: TextSelection Object