LineUp Method (TextSelection Object)
Moves the selected line up a specified number of lines.
Public Sub LineUp( _ Optional ByVal Extend As Boolean = False, _ Optional ByVal Count As Integer = 1 _ )
Sub LineUp( _ Optional ByVal Extend As Boolean = False, _ Optional ByVal Count As Long = 1 _ )
HRESULT __stdcall LineUp( VARIANT_BOOL Extend, long Count );
public void LineUp( bool Extend, int Count );
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) objSel.LineUp(True) End Sub
Applies To: TextSelection Object