TextSelection.EndOfLine メソッド

更新 : 2007 年 11 月

オブジェクトを現在の行の末尾に移動します。

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

構文

'宣言
Sub EndOfLine ( _
    Extend As Boolean _
)
'使用
Dim instance As TextSelection
Dim Extend As Boolean

instance.EndOfLine(Extend)
void EndOfLine(
    bool Extend
)
void EndOfLine(
    [InAttribute] bool Extend
)
function EndOfLine(
    Extend : boolean
)

パラメータ

  • Extend
    型 : System.Boolean

    省略可能です。移動したテキストの範囲選択を解除するかどうかを指定します。既定値は、false です。

解説

Extend が true の場合は、選択したテキストのアクティブな終点だけが移動します。それ以外の場合は、選択した文字列が折りたたまれてドキュメントの末尾に配置されます。

Sub EndOfLineExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   Dim objActive As VirtualPoint = objSel.ActivePoint
   ' Collapse the selection to the beginning of the line.
   objSel.StartOfLine()
   ' objActive is "live", tied to the position of the actual selection, 
   ' so it will reflect the new position.
   Dim iCol As Long = objActive.DisplayColumn
   ' Move the selection to the end of the line.
   objSel.EndOfLine()

   MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
End Sub

アクセス許可

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

参照

参照

TextSelection インターフェイス

TextSelection メンバ

EnvDTE 名前空間