Share via


TextSelection.DeleteLeft (Método)

Elimina un número especificado de caracteres a la izquierda del punto activo.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
Sub DeleteLeft ( _
    Count As Integer _
)
void DeleteLeft(
    int Count
)
void DeleteLeft(
    [InAttribute] int Count
)
abstract DeleteLeft : 
        Count:int -> unit
function DeleteLeft(
    Count : int
)

Parámetros

  • Count
    Tipo: Int32

    Opcional. Representa el número de caracteres que se van a eliminar.

Comentarios

Si la selección de texto está vacía, DeleteLeft elimina el número indicado de caracteres a la izquierda del extremo activo. Si el valor de Count es negativo, DeleteLeft se comportará como el método Delete.

Ejemplos

Public objSel As TextSelection = DTE.ActiveDocument.Selection

Sub DeleteLeftExample()
   ' Before running this example, open a text document.
   ' Perform operations on the text.
   objSel.StartOfDocument(False)
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, 4)
   objSel.Copy()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.Cut()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.Delete()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.DeleteLeft(6)
   objSel.DestructiveInsert("NEW TEXT")
End Sub

Sub Position(ByVal pos As vsStartOfLineOptions, ByVal ipos As Integer)
   ' Moves the insertion point down to the beginning of the next line, 
   ' and then highlights the right-most four characters.
   objSel.LineDown()
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
End Sub

Seguridad de .NET Framework

Vea también

Referencia

TextSelection Interfaz

EnvDTE (Espacio de nombres)