EditPoint.PadToColumn(Int32) Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Preenche a linha atual no buffer com caracteres vazios (espaço em branco) para a coluna especificada.
public:
void PadToColumn(int Column);
public:
void PadToColumn(int Column);
void PadToColumn(int Column);
[System.Runtime.InteropServices.DispId(131)]
public void PadToColumn (int Column);
[<System.Runtime.InteropServices.DispId(131)>]
abstract member PadToColumn : int -> unit
Public Sub PadToColumn (Column As Integer)
Parâmetros
- Column
- Int32
Obrigatórios. O número de colunas a ser pad, começando em uma.
- Atributos
Exemplos
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();
}
}
Comentários
PadToColumn insere tabulações e espaços, de acordo com as configurações globais, da coluna de exibição do ponto de edição ou da seleção para a coluna de exibição especificada. Se o ponto de edição ou o fim ativo da seleção já estiver além da coluna especificada, PadToColumn não fará nada.