مشاركة عبر


TextSelection.AnchorPoint الخاصية

يحصل على يؤشر الأصل في تحديد.

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

بناء الجملة

'إقرار
ReadOnly Property AnchorPoint As VirtualPoint
    Get
VirtualPoint AnchorPoint { get; }
property VirtualPoint^ AnchorPoint {
    VirtualPoint^ get ();
}
abstract AnchorPoint : VirtualPoint
function get AnchorPoint () : VirtualPoint

قيمة الخاصية

النوع: EnvDTE.VirtualPoint
كائن VirtualPoint .

ملاحظات

على الرغم من أن TextPointالكائنات الإشارة إلى الموقع نص محدد في نافذة محرر، فإنها لا تضع علامة الموقع في احتياطي. ظاهري مساحة — المنطقة بعد نهاية الخط — يتم تعقب أيضا في الإطار محرر فقط. وبالتالي، عند استخدام EditPointفي احتياطي للنص لتعديل النص، ماذا يحدث للنص المحدد هو غير معرفة. على سبيل المثال comm و قد تبدأ بالنص المحدد، قم بتحرير يحصل نقاط، و قم بتغيير احتياطي. لضمان أن النص المحدد هو في مكان معين، يجب عليك صراحة وضع النص المحدد في هذا الموقع في إنهاء الأمر.

أمثلة

Sub AnchorPointExample()
    ' Before running this example, open a text document.
    Dim objSel As TextSelection = DTE.ActiveDocument.Selection
    Dim objAnchor As VirtualPoint = objSel.AnchorPoint
    ' objAnchor is "live", tied to the position of the actual selection, 
    ' so it will reflect any changes. iCol and iRow are created here to 
    ' save a "snapshot" of the anchor point's position at this time.
    Dim iCol As Long = objAnchor.DisplayColumn
    Dim iRow As Long = objAnchor.Line
    ' As the selection is extended, the active point moves but the anchor 
    ' point remains in place.
    objSel.StartOfDocument(True)
    objSel.EndOfDocument(True)

    If (iCol = objAnchor.DisplayColumn And iRow = objAnchor.Line) Then
        MsgBox("The anchor point has remained in place at row " & iRow & ", display column " & iCol)
    End If
End Sub

أمن NET Framework.

راجع أيضًَا

المرجع

TextSelection واجهة

TextSelection الأعضاء

EnvDTE مساحة الاسم