Partager via


EditPoint2.PadToColumn, méthode (Int32)

Remplit la ligne active de la mémoire tampon avec des caractères vides (espace blanc) jusqu'à la colonne donnée.

Espace de noms :  EnvDTE80
Assembly :  EnvDTE80 (dans EnvDTE80.dll)

Syntaxe

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

Paramètres

  • Column
    Type : System.Int32
    Obligatoire.Nombre de colonnes à compléter par des espaces, en commençant à 1.

Implémentations

EditPoint.PadToColumn(Int32)

Notes

PadToColumn insère des tabulations et des espaces, selon les paramètres globaux, à partir de la colonne d'affichage du point d'édition ou de la sélection jusqu'à la colonne d'affichage spécifiée. Si le point d'édition ou l'extrémité active de la sélection se trouve au-delà de la colonne spécifiée, PadToColumn n'a pas d'effet.

Exemples

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 ten 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 ten 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();
    }
}

Sécurité .NET Framework

Voir aussi

Référence

EditPoint2 Interface

PadToColumn, surcharge

EnvDTE80, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation