다음을 통해 공유


TextSelection.LineUp(Boolean, Int32) Method

Definition

Moves the insertion point of the text selection up the specified number of lines.

void LineUp(bool Extend = false, int Count = 1);
[System.Runtime.InteropServices.DispId(37)]
public void LineUp (bool Extend = false, int Count = 1);
[<System.Runtime.InteropServices.DispId(37)>]
abstract member LineUp : bool * int -> unit
Public Sub LineUp (Optional Extend As Boolean = false, Optional Count As Integer = 1)

Parameters

Extend
Boolean

Optional. Determines whether the line in which the insertion point is moved is highlighted. The default is false.

Count
Int32

Optional. Indicates how many lines up to move the insertion point. The default is 1.

Attributes

Examples

Sub LineUpExample()  
   ' Before running this example, open a text document containing  
   ' at least 4 lines of text.  
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection  
   ' Go to fourth line in document and then move up one line.  
   objSel.GotoLine(4, False)  
   objSel.LineUp(True, 1)  
End Sub  

Remarks

LineUp moves the insertion point of the text selection up Count number of lines from its current position. If Extend is true, then the new line is highlighted after the insertion point is moved. 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 the LineDown method.

Applies to