다음을 통해 공유


EditPoint2.PadToColumn 메서드

버퍼의 현재 줄을 지정한 열까지 빈 문자(공백)로 채웁니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

‘선언
Sub PadToColumn ( _
    Column As Integer _
)
void PadToColumn(
    int Column
)
void PadToColumn(
    [InAttribute] int Column
)
abstract PadToColumn : 
        Column:int -> unit
function PadToColumn(
    Column : int
)

매개 변수

  • Column
    형식: Int32

    필수입니다. 1에서 시작하여 채워질 열 수입니다.

설명

PadToColumn은 전역 설정에 따라 편집 지점 또는 선택 영역의 표시 열에서 지정된 표시 열까지 탭과 공백을 삽입합니다. 편집 지점이나 선택 영역의 활성 끝 지점이 지정한 열을 이미 넘은 경우 PadToColumn은 아무것도 수행하지 않습니다.

예제

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

.NET Framework 보안

참고 항목

참조

EditPoint2 인터페이스

EnvDTE80 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행