Partilhar via


Propriedade TextSelection.ActivePoint

Obtém o ponto final de seleção atual.

Namespace:  EnvDTE
Assembly:  EnvDTE (em EnvDTE.dll)

Sintaxe

'Declaração
ReadOnly Property ActivePoint As VirtualPoint
VirtualPoint ActivePoint { get; }
property VirtualPoint^ ActivePoint {
    VirtualPoint^ get ();
}
abstract ActivePoint : VirtualPoint with get
function get ActivePoint () : VirtualPoint

Valor de propriedade

Tipo: EnvDTE.VirtualPoint
Um objeto VirtualPoint.

Comentários

Embora os objetos de TextPoint indicarem o local de seleção de texto na janela de Editor , não marcam o local no buffer. O espaço virtual — a área além do final da linha — também é controlado somente na janela de Editor . Portanto, quando você usa um objeto de EditPoint no buffer de texto para alterar o texto, o que acontece a seleção de texto não está definido. Por exemplo, um comando pode começar com seleção de texto, obtém pontos de edição, e altera ao buffer. Para garantir a seleção de texto está em algum local, você deve explicitamente colocar a seleção de texto naquele local no final do comando.

Exemplos

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

Segurança do .NET Framework

Consulte também

Referência

TextSelection Interface

Namespace EnvDTE