Proprietà EditPoint2.DisplayColumn

Ottiene il numero di contenere attualmente visualizzate delle colonne EditPoint oggetto.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
ReadOnly Property DisplayColumn As Integer
int DisplayColumn { get; }
property int DisplayColumn {
    int get ();
}
abstract DisplayColumn : int
function get DisplayColumn () : int

Valore proprietà

Tipo: System.Int32
Il numero di contenere attualmente visualizzate delle colonne EditPoint oggetto.

Note

L'avvio di numerazione di una colonna in un tipo.La colonna di visualizzazione può essere diverso dal valore di LineCharOffset se la riga contiene i caratteri di tabulazione.DisplayColumn viene utilizzata l'impostazione globale per la dimensione della tabulazione per determinare la colonna viene visualizzata.

Esempi

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.\n");

    // Display EditPoint properties.
    MessageBox.Show(
        "AbsoluteCharOffset: " + point.AbsoluteCharOffset + "\n" + 
        "DisplayColumn: " + point.DisplayColumn + "\n" + 
        "AtEndOfDocument: " + point.AtEndOfDocument + "\n" + 
        "AtEndOfLine: " + point.AtEndOfLine + "\n" + 
        "AtStartOfDocument: " + point.AtStartOfDocument + "\n" + 
        "AtStartOfLine: " + point.AtStartOfLine);
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

EditPoint2 Interfaccia

Overload DisplayColumn

Spazio dei nomi EnvDTE80

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione