EditPoint2.Line 属性

定义

获取对象的行号 EditPoint

public:
 property int Line { int get(); };
public:
 property int Line { int get(); };
[System.Runtime.InteropServices.DispId(11)]
public int Line { [System.Runtime.InteropServices.DispId(11)] get; }
[<System.Runtime.InteropServices.DispId(11)>]
[<get: System.Runtime.InteropServices.DispId(11)>]
member this.Line : int
Public ReadOnly Property Line As Integer

属性值

Int32

EditPoint 对象的行号。

实现

属性

示例

public void Example(DTE2 dte)  
{  
   try  
   {  
      // Open a text document before running this example.  
      TextDocument objTD, objTD2;  
      EditPoint objEP;  

      objTD = (TextDocument)dte.ActiveDocument.Object("TextDocument");  
      objEP = (EditPoint)objTD.StartPoint.CreateEditPoint();  
      objEP.Insert("Hello ");  
      // Show line number at editpoint.  
      MessageBox.Show("EditPoint is at line #: " + objEP.Line);  
      objTD2 = objEP.Parent;  
      MessageBox.Show(objTD2.Type);  
   }  
   catch (Exception ex)  
   {  
      MessageBox.Show(ex.Message);  
   }  
}  

注解

行号从1开始。

适用于