This documentation is archived and is not being maintained.

LineUp Method (TextSelection Object)

Visual Studio .NET 2003

Moves the selected line up a specified number of lines.

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


Optional. Determines whether the moved text is collapsed or not. The default is False.
Optional. Indicates how many lines to move up. The default is 1.


Moves the selected text up Count number of lines from the current position. If Extend is True, then the active end of the selected text is moved up Count lines, otherwise, it's collapsed and positioned Count lines up from the active end. If the beginning of the document is encountered before Count lines, then the position remains at the beginning of the document. LineUp tries to match the display column from the line of origin to the target line, rounding down a character position, if necessary, if it ends up in the middle of a tab on the target line.

If the value of Count is negative, then LineUp performs like LineDown.


Sub LineUpExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   ' Go to second line in document and then move up one line.
   objSel.GotoLine(2, False)
End Sub

See Also

Applies To: TextSelection Object