TextSelection الواجهة

وصولاً إلى العمليات التي تعتمد على طريقة عرض التحرير و نص محدد.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
<GuidAttribute("1FA0E135-399A-4D2C-A4FE-D21E2480F921")> _
Public Interface TextSelection
[GuidAttribute("1FA0E135-399A-4D2C-A4FE-D21E2480F921")]
public interface TextSelection
[GuidAttribute(L"1FA0E135-399A-4D2C-A4FE-D21E2480F921")]
public interface class TextSelection
[<GuidAttribute("1FA0E135-399A-4D2C-A4FE-D21E2480F921")>]
type TextSelection =  interface end
public interface TextSelection

ملاحظات

خصائص وأساليب TextSelectionكائن مباشرة بعكس محرر الأوامر في Visual Studioبيئة التطوير المتكاملة (IDE). مثل بيئة، تحديد النص الالعمليات تتأثر بحالة محرر's عمومي، مثل ما إذا كان في الكتابة فوق الوضع أو الوضع مسافة بيضاء الظاهري.

تشغيل أي محاولة إلى تعديل مستند نصي يفشل إذا هو يؤثر على أية أحرف في قراءة-فقط حظر، أو نص المستند نفسه كان القراءة فقط.

بعض TextSelectionقد تفشل الخصائص والأساليب الخاصة بالكائن في حالة مستند المقترن هو على مستند HTML. أسباب الفشل المحتملة: الإطارات ذلك المستند dهوplay HTML غير موجودة في طريقة عرض المصدر أو بيانات الموجودة خلف نص المستند هو مؤمناً.

أمثلة

Sub TextSelectionExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   Dim objActive As VirtualPoint = objSel.ActivePoint
   ' Collapse the selection to the beginning of the line.
   objSel.StartOfLine()
   ' objActive is "live", tied to the position of the actual selection, 
   ' so it will reflect the new position.
   Dim iCol As Long = objActive.DisplayColumn
   ' Move the selection to the end of the line.
   objSel.EndOfLine()

   MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
End Sub

راجع أيضًَا

المرجع

TextSelection الأعضاء

EnvDTE مساحة الاسم