EditPoint.DisplayColumn EditPoint.DisplayColumn EditPoint.DisplayColumn EditPoint.DisplayColumn Property

Definition

Gets the number of the column number of the EditPoint object.

public:
 property int DisplayColumn { int get(); };
[System.Runtime.InteropServices.DispId(14)]
[get: System.Runtime.InteropServices.DispId(14)]
public int DisplayColumn { get; }
member this.DisplayColumn : int
Public ReadOnly Property DisplayColumn As Integer
Property Value

The number of the currently displayed column containing the EditPoint object.

Implements

Examples

Sub DisplayColumnExample(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  

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

    End Sub  
public void DisplayColumnExample(DTE2 dte)  
{  
    // Create a new text file.  
    dte.ItemOperations.NewFile(@"General\Text File", "",   
        Constants.vsViewKindPrimary);  

    // Create an EditPoint at the start of the new document.  
    TextDocument doc =   
        (TextDocument)dte.ActiveDocument.Object("TextDocument");  
    EditPoint point = doc.StartPoint.CreateEditPoint();  

    // Insert 10 lines of text.  
    for (int i = 1; i <= 10; ++i)  
        point.Insert("This is a test.
"); // Display EditPoint properties. MessageBox.Show( "AbsoluteCharOffset: " + point.AbsoluteCharOffset + "
" + "DisplayColumn: " + point.DisplayColumn + "
" + "AtEndOfDocument: " + point.AtEndOfDocument + "
" + "AtEndOfLine: " + point.AtEndOfLine + "
" + "AtStartOfDocument: " + point.AtStartOfDocument + "
" + "AtStartOfLine: " + point.AtStartOfLine); }

Remarks

The column numbering starts at one. The display column may be different from the value of the LineCharOffset if the line contains tab characters. DisplayColumn uses the global setting for tab size to determine the displayed column.

Applies to