Export (0) Print
Expand All
Cut
Run
Expand Minimize
0 out of 2 rated this helpful - Rate this topic

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 _
) 
[C++]
HRESULT __stdcall MoveToDisplayColumn(
   long Line,
   long Column,
   VARIANT_BOOL Extend
);
[C#]
public void MoveToDisplayColumn(
   int Line,
   int Column,
   bool Extend
);
[JScript .NET]
public function MoveToDisplayColumn(
   Line : int,
   Column : int,
   Extend : Boolean
)

Parameters

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

Remarks

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.

Example

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.