Export (0) Print
Expand All
Cut
Run
Expand Minimize

DeleteLeft Method

Visual Studio .NET 2003

Deletes a specified number of characters to the left of the active point.

[Visual Basic .NET]
Public Sub DeleteLeft( _
   Optional ByVal Count As Integer = 1 _
) 
[Visual Basic 6]
Sub DeleteLeft( _
   Optional ByVal Count As Long = 1 _
) 
[C++]
HRESULT __stdcall DeleteLeft(
   long Count
);
[C#]
public void DeleteLeft(
   int Count
);
[JScript .NET]
public function DeleteLeft(
   Count : int
)

Parameters

Count
Optional. Represents the number of characters to delete.

Remarks

If the text selection is empty, then DeleteLeft deletes the indicated number of characters to the left of the active end point. If the value of Count is negative, then DeleteLeft performs like the Delete Method (TextSelection Object).

Example

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

See Also

Applies To: TextSelection Object

Show:
© 2014 Microsoft