TextSelection::GotoLine Method (Int32, Boolean)

 

Moves to the beginning of the indicated line and selects the line if requested.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

void GotoLine(
	int Line,
	bool Select = false
)

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
Return to top
Show: