Share via


EditPoint.PadToColumn-Methode

Füllt die aktuelle Zeile im Puffer bis zur angegebenen Spalte mit Leerzeichen (Leerraum) auf.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub PadToColumn ( _
    Column As Integer _
)
void PadToColumn(
    int Column
)
void PadToColumn(
    [InAttribute] int Column
)
abstract PadToColumn : 
        Column:int -> unit
function PadToColumn(
    Column : int
)

Parameter

  • Column
    Typ: Int32

    Erforderlich. Die Anzahl der aufzufüllenden Spalten, beginnend bei eins.

Hinweise

PadToColumn fügt entsprechend den globalen Einstellungen von der Anzeigespalte des Bearbeitungspunktes oder der Auswahl bis zur angegebenen Anzeigespalte Tabulatoren und Leerzeichen ein. Wenn der Bearbeitungspunkt oder das aktive Ende der Auswahl bereits hinter der angegebenen Spalte liegt, führt PadToColumn keine Aktion aus.

Beispiele

Sub PadToColumnExample(ByVal dte As DTE2)

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

    ' Create an EditPoint at the start of the new file.
    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 i

    point.StartOfDocument()

    ' Indent text to column 10.
    For i = 1 To 10
        point.PadToColumn(10)
        point.LineDown()
        point.StartOfLine()
    Next

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

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

    // Insert 10 lines of text.
    for (int i = 0; i < 10; i++)
        point.Insert("This is a test.\n");

    point.StartOfDocument();

    // Indent text to column 10.
    for (int i = 0; i < 10; i++)
    {
        point.PadToColumn(10);
        point.LineDown(1);
        point.StartOfLine();
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

EditPoint Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell