TextSelection.GotoLine メソッド

更新 : 2007 年 11 月

要求に応じて、指示された行の先頭に移動し、その行を選択します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
Sub GotoLine ( _
    Line As Integer, _
    Select As Boolean _
)
'使用
Dim instance As TextSelection
Dim Line As Integer
Dim Select As Boolean

instance.GotoLine(Line, Select)
void GotoLine(
    int Line,
    bool Select
)
void GotoLine(
    [InAttribute] int Line, 
    [InAttribute] bool Select
)
function GotoLine(
    Line : int, 
    Select : boolean
)

パラメータ

  • Line
    型 : System.Int32

    必ず指定します。1 から開始する、移動先の行番号。

  • Select
    型 : System.Boolean

    省略可能です。対象の行を選択するかどうかを示します。既定値は false です。

解説

GotoLine は TextSelection.MoveToLineAndOffset(Line, 0, False) と同じ効果があります。Select が true の場合、GotoLine は 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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

TextSelection インターフェイス

TextSelection メンバ

EnvDTE 名前空間