Op Englesch liesen

Deelen iwwer


EditPoint.LineLength Property

Definition

Gets the number of characters in a line.

C++/CX
public:
 property int LineLength { int get(); };

Property Value

The number of characters in a line containing the EditPoint object, excluding the new line character.

Implements

Attributes

Examples

VB
Sub LineLengthExample(ByVal dte As DTE2)  

    ' Create a new text file.  
    dte.ItemOperations.NewFile()  

    ' Create an EditPoint at the start of the new document.  
    Dim doc As TextDocument = _  
        CType(dte.ActiveDocument.Object("TextDocument"), TextDocument)  
    Dim point As EditPoint = doc.StartPoint.CreateEditPoint  
    Dim i As Integer  

    ' Insert 10 lines of text.  
    For i = 1 To 10  
        point.Insert("This is a test." & vbCrLf)  
    Next  

    point.StartOfDocument()  

    ' Display EditPoint properties.  
    MsgBox( _  
        "AbsoluteCharOffset: " & point.AbsoluteCharOffset & vbCrLf & _  
        "LineCharOffset: " & point.LineCharOffset & vbCrLf & _  
        "DisplayColumn: " & point.DisplayColumn & vbCrLf & _  
        "AtEndOfDocument: " & point.AtEndOfDocument & vbCrLf & _  
        "AtEndOfLine: " & point.AtEndOfLine & vbCrLf & _  
        "AtStartOfDocument: " & point.AtStartOfDocument & vbCrLf & _  
        "AtStartOfLine: " & point.AtStartOfLine & vbCrLf & _  
        "LineLength: " & point.LineLength)  

End Sub  

Remarks

Character numbering begins at one.

Applies to

Produkt Versiounen
Visual Studio SDK 2015, 2017, 2019, 2022