Freigeben über


TextSelection.DeleteLeft-Methode

Löscht eine bestimmte Anzahl von Zeichen links vom aktiven Punkt.

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

Syntax

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

Parameter

  • Count
    Typ: Int32

    Optional. Stellt die Anzahl der zu löschenden Zeichen dar.

Hinweise

Wenn die Textmarkierung leer ist, löscht DeleteLeft die angegebene Anzahl von Zeichen links neben dem aktiven Endpunkt. Wenn der Wert von Count negativ ist, verhält sich DeleteLeft wie die Delete-Methode.

Beispiele

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

.NET Framework-Sicherheit

Siehe auch

Referenz

TextSelection Schnittstelle

EnvDTE-Namespace