TextSelection.AnchorPoint Özellik

Tanım

Seçimin kaynak noktasını alır.

public:
 property EnvDTE::VirtualPoint ^ AnchorPoint { EnvDTE::VirtualPoint ^ get(); };
public:
 property EnvDTE::VirtualPoint ^ AnchorPoint { EnvDTE::VirtualPoint ^ get(); };
[System.Runtime.InteropServices.DispId(3)]
public EnvDTE.VirtualPoint AnchorPoint { [System.Runtime.InteropServices.DispId(3)] get; }
[<System.Runtime.InteropServices.DispId(3)>]
[<get: System.Runtime.InteropServices.DispId(3)>]
member this.AnchorPoint : EnvDTE.VirtualPoint
Public ReadOnly Property AnchorPoint As VirtualPoint

Özellik Değeri

VirtualPoint

Bir VirtualPoint nesnesi.

Öznitelikler

Örnekler

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  

Açıklamalar

TextPointNesneler, Düzenleyici penceresinde metin seçiminin konumunu belirtebilse de, arabellekteki konumu işaretlemez. Sanal alan — satırın sonundaki alan — yalnızca Düzenleyici penceresinde de izlenir. Sonuç olarak, metni EditPoint değiştirmek için metin arabelleğindeki bir kullandığınızda, metin seçimine ne olur. Örneğin, bir komut metin seçimiyle başlayabilir, düzenleme noktaları alabilir ve ardından arabelleği değiştirebilir. Metin seçiminin belirli bir konumda olduğunu garantilemek için, metin seçimini komutun sonunda bu konuma açıkça yerleştirmeniz gerekir.

Şunlara uygulanır