Export (0) Print
Expand All
Cut
Run
Expand Minimize

PadToColumn Method (General Extensibility)

Visual Studio .NET 2003

Fills the current line in the buffer with empty characters (white space) to the given column.

[Visual Basic .NET]
Public Sub PadToColumn( _
   ByVal Column As Long _
) 
[Visual Basic 6]
Sub PadToColumn( _
   ByVal Column As Long _
) 
[C++]
HRESULT __stdcall PadToColumn(
   long Column
);
[C#]
void PadToColumn(
   int Column
);
[JScript .NET]
public function PadToColumn(
   Column : int
)

Parameters

Column
Required. The number of columns to pad, starting at one.

Remarks

PadToColumn inserts tabs and spaces, according to global settings, from the edit point's or selection's display column to the specified display column. If the edit point or active end of the selection already lies beyond the specified column, PadToColumn does nothing. For TextSelection.PadToColumn, the selection immediately follows the inserted white space and is collapsed.

Example

Sub PadToColumnExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   'Create a new text file.
   Call DTE.ItemOperations.NewFile("General\Text File")
       
   'Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
        
   'Insert ten lines of text.
   For iCtr = 1 To 10
     objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
       
   objEditPt.StartOfDocument()
   objEditPt.PadToColumn(10)
End Sub

See Also

Applies To: EditPoint Object | TextSelection Object

Show:
© 2014 Microsoft