EditPoint.PadToColumn أسلوب
Fills the السطر الحالي في the احتياطي مع فارغ حرف/ حروف (أبيض مسافة) إلى the given عمود.
مساحة الاسم: EnvDTE
التجميع: EnvDTE (في EnvDTE.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
النوع: System.Int32
مطلوبة.The عدد أعمدة إلى pad, البدء at واحد.
ملاحظات
PadToColumn inserts علامات التبويب و مسافات, according إلى عمومي إعدادات, من the تحرير يؤشر's أو تحديد's عرض عمود إلى the specified عرض عمود. If the تحرير يؤشر أو نشط إنهاء of the تحديد already lies beyond the specified عمود, PadToColumn does لا شيء.
أمثلة
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.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.
راجع أيضًَا
المرجع
موارد أخرى
كيفية: الترجمة وإعادة تشغيل أمثلة التعليمات البرمجية لطراز كائن التنفيذ التلقائي