Export (0) Print
Expand All
Cut
Run
Expand Minimize

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

Parameters

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

Remarks

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.

Example

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)
   objSel.LineUp(True)
End Sub

See Also

Applies To: TextSelection Object

Show:
© 2014 Microsoft