TextSelection.ActivePoint (Propiedad)
Obtiene el extremo actual de la selección.
Espacio de nombres: EnvDTE
Ensamblado: EnvDTE (en EnvDTE.dll)
Sintaxis
'Declaración
ReadOnly Property ActivePoint As VirtualPoint
VirtualPoint ActivePoint { get; }
property VirtualPoint^ ActivePoint {
VirtualPoint^ get ();
}
abstract ActivePoint : VirtualPoint with get
function get ActivePoint () : VirtualPoint
Valor de propiedad
Tipo: EnvDTE.VirtualPoint
Un objeto VirtualPoint.
Comentarios
Aunque los objetos de TextPoint indican la ubicación de la selección de texto en la ventana de Editor , no marcan la ubicación en el búfer. El espacio virtual (el área situada más allá del final de la línea) se controla también solamente en la ventana Editor. Por consiguiente, cuando se usa un objeto de EditPoint en el búfer de texto para modificar el texto, lo que sucede con la selección de texto no está definido. Por ejemplo, un comando puede comenzar con la selección de texto, recopila los puntos de edición, y después cambia el búfer. Para garantizar la selección de texto está en una determinada ubicación, debe colocar explícitamente la selección de texto en esa ubicación al final del comando.
Ejemplos
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
Seguridad de .NET Framework
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.