Aracılığıyla paylaş


TextSelection.AnchorPoint Özellik

Seçimin başlangıç noktası alır.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property AnchorPoint As VirtualPoint
VirtualPoint AnchorPoint { get; }
property VirtualPoint^ AnchorPoint {
    VirtualPoint^ get ();
}
abstract AnchorPoint : VirtualPoint with get
function get AnchorPoint () : VirtualPoint

Özellik Değeri

Tür: EnvDTE.VirtualPoint
VirtualPoint nesnesi.

Notlar

Ancak TextPoint nesneleri metin seçimini konumunu belirtmek Düzenleyicisi penceresinde, tampon konumda işaretlemeyin.Sanal alan — alanı satırın sonuna kadar ötesinde — de yalnızca izlenen Düzenleyicisi pencere.Sonuç olarak kullandığınızda, bir EditPoint metin ara metni değiştirmek için metin seçimi neler tanımlı değil.Örneğin bir komut metin seçimle başlayın, Düzen puan alırsınız ve sonra arabellek değiştirin.Metin seçimini belirli bir konumda olduğunu güvence altına almak için açıkça metin seçimini o konumda, komutun sonuna koymanız gerekir.

Ö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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

TextSelection Arabirim

EnvDTE Ad Alanı