TextSelection.ActivePoint الخاصية
يحصل على نهاية تحديد الحالي.
مساحة الاسم: EnvDTE
التجميع: EnvDTE (في EnvDTE.dll)
بناء الجملة
'إقرار
ReadOnly Property ActivePoint As VirtualPoint
Get
VirtualPoint ActivePoint { get; }
property VirtualPoint^ ActivePoint {
VirtualPoint^ get ();
}
abstract ActivePoint : VirtualPoint
function get ActivePoint () : VirtualPoint
قيمة الخاصية
النوع: EnvDTE.VirtualPoint
كائن VirtualPoint .
ملاحظات
على الرغم من أن TextPointالكائنات الإشارة إلى الموقع نص محدد في نافذة محرر، فإنها لا تضع علامة الموقع في احتياطي. ظاهري مساحة — المنطقة بعد نهاية الخط — يتم تعقب أيضا في الإطار محرر فقط. وبالتالي، عند استخدام EditPointالكائن في احتياطي للنص لتعديل نص، وماذا يحدث للنص المحدد هو غير معرفة. على سبيل المثال، قد أمر يبدأ مع نص محدد، الحصول على نقاط التحرير ثم قم بتغيير احتياطي. لضمان أن النص المحدد هو في مكان معين، يجب عليك صراحة وضع النص المحدد في هذا الموقع في إنهاء الأمر.
أمثلة
Sub ActivePointExample()
' 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
أمن NET Framework.
- الثقة الكاملة للمتصل الفوري. يتعذر استخدام هذا العضو بواسطة التعليمات البرمجية الموثوق بها جزئيًا. لمزيد من المعلومات، راجع باستخدام مكتبات من تعليمات برمجية موثوق بها جزئي.