共用方式為


TextPoint.Line 屬性

取得物件的行號。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property Line As Integer
int Line { get; }
property int Line {
    int get ();
}
abstract Line : int
function get Line () : int

屬性值

型別:System.Int32
指示物件行號的整數值。

備註

行號從 1 開始。

範例

Sub LineExample()
   Dim objTextDoc As TextDocument
   Dim objTP As TextPoint, iCtr As Integer
   Dim msg As String

   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")

   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objTP = objTextDoc.StartPoint.CreateEditPoint

   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objTP.Insert("This is a test." & Chr(13))
   Next iCtr

   ' Display text point location information.
   objTP.StartOfDocument()
   msg = "DisplayColumn value: " & objTP.DisplayColumn & vbCr
   msg = msg & "Line value: " & objTP.Line & vbCr
   msg = msg & "LineCharOffset value: " & objTP.LineCharOffset & vbCr
   msg = msg & "LineLength value: " & objTP.LineLength & vbCr
   MsgBox(msg)
End Sub

.NET Framework 安全性

請參閱

參考

TextPoint 介面

EnvDTE 命名空間