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
function get AnchorPoint () : VirtualPoint

Özellik Değeri

Tür: EnvDTE.VirtualPoint
VirtualPoint nesnesi

Notlar

Ancak TextPoint nesneler seçili metnin konumunu belirtmek Düzenleyen penceresinde, tampon konumda işaretlemeyin.Sanal adres alanı — alanı satır sonunun ötesine — yalnızca izlenen de Düzenleyen pencere.Sonuç olarak kullandığınızda, bir EditPoint metin arabellek metni değiştirmek için seçili metne neler tanımlı değil.Örneğin bir komut Başlat Seçili metinle, Düzen puan alırsınız ve arabellek değiştirin.Seçili metni belirli bir konumda olduğunu güvence altına almak için açıkça seçili metni bu konumda komutunuzu sonunda 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ı