Compartilhar via


Método TextSelection.Delete

Exclui o texto selecionado.

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

Sintaxe

'Declaração
Sub Delete ( _
    Count As Integer _
)
void Delete(
    int Count
)
void Delete(
    [InAttribute] int Count
)
abstract Delete : 
        Count:int -> unit 
function Delete(
    Count : int
)

Parâmetros

  • Count
    Tipo: System.Int32
    Opcional.Representa o número de caracteres para excluir.

Comentários

DeleteExclui o texto selecionado sem copiá-lo primeiro na área de transferência.Se nenhum texto for selecionado, em seguida, Delete exclui Count caracteres à direita do ponto final ativo.Se Count for negativo, em seguida, Delete desempenho igual a DeleteLeft.

Exemplos

Public objSel As TextSelection = DTE.ActiveDocument.Selection

Sub DeleteExample()
   ' 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, 
   ' then highlights the right-most four characters.
   objSel.LineDown()
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
End Sub

Segurança do .NET Framework

Consulte também

Referência

TextSelection Interface

Namespace EnvDTE