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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。