EditPoint.Delete(Object) Método

Definição

Exclui o intervalo de texto especificado.

public:
 void Delete(System::Object ^ PointOrCount);
public:
 void Delete(Platform::Object ^ PointOrCount);
void Delete(winrt::Windows::Foundation::IInspectable const & PointOrCount);
[System.Runtime.InteropServices.DispId(135)]
public void Delete (object PointOrCount);
[<System.Runtime.InteropServices.DispId(135)>]
abstract member Delete : obj -> unit
Public Sub Delete (PointOrCount As Object)

Parâmetros

PointOrCount
Object

Obrigatórios. Representa um TextPoint objeto ou um número de caracteres.

Atributos

Exemplos

Sub DeleteExample()  
   Dim objTextDoc As TextDocument  
   Dim objEditPt As EditPoint, iCtr As Integer  

   ' Create a new text file.  
   DTE.ItemOperations.NewFile("General\Text File")  

   ' Get a handle to the new document and create an EditPoint.  
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")  
   objEditPt = objTextDoc.StartPoint.CreateEditPoint  

   ' Insert ten lines of text.  
   For iCtr = 1 To 10  
      objeditpt.Insert("This is a test." & Chr(13))  
   Next iCtr  

   ' Change the first letter of the fourth word of the fourth line.  
   objEditPt.StartOfDocument()  
   objEditPt.LineDown(3)  
   objEditPt.WordRight(3)  
   objEditPt.CharRight(2)  
   objEditPt.Charleft(2)  
   objeditpt.Delete(1)  
   objEditPt.Insert("p")  
End Sub  

Comentários

Se PointOrCount for um TextPoint objeto, Delete o excluirá o texto entre o ponto de edição e o PointOrCount . Se PointOrCount for um inteiro, Delete excluirá o texto do ponto de edição por meio do número especificado de caracteres após o ponto de edição, adicionando um para cada sequência de nova linha implícita no final de cada linha.

Se PointOrCount for negativo, o Delete excluirá o texto antes do ponto de edição.

Aplica-se a