TextSelection.DeleteLeft(Int32) Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Exclui um número especificado de caracteres à esquerda do ponto ativo.
void DeleteLeft(int Count = 1);
[System.Runtime.InteropServices.DispId(24)]
public void DeleteLeft (int Count = 1);
[<System.Runtime.InteropServices.DispId(24)>]
abstract member DeleteLeft : int -> unit
Public Sub DeleteLeft (Optional Count As Integer = 1)
Parâmetros
- Count
- Int32
Opcional. Representa o número de caracteres a serem excluídos.
- Atributos
Exemplos
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
Comentários
Se a seleção de texto estiver vazia, DeleteLeft o excluirá o número indicado de caracteres à esquerda do ponto de extremidade ativo. Se o valor de Count for negativo, o será DeleteLeft executado como o Delete método.