TextSelection::GotoLine Method (Int32, Boolean)
Visual Studio 2015
Moves to the beginning of the indicated line and selects the line if requested.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- Line
-
Type:
System::Int32
Required. The line number to go to, beginning at one.
- Select
-
Type:
System::Boolean
Optional. Indicates whether the target line should be selected. The default is false.
GotoLine has the same effect as TextSelection.MoveToLineAndOffset(Line, 0, False). If Select is true, then GotoLine also performs EndOfLine(True).
Sub GotoLineExample() ' 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) End Sub
Show: