ITextEdit.Delete 方法

定义

重载

Delete(Span)

从缓冲区中删除字符序列。

Delete(Int32, Int32)

从缓冲区中删除 equence 的字符。

Delete(Span)

从缓冲区中删除字符序列。

public:
 bool Delete(Microsoft::VisualStudio::Text::Span deleteSpan);
public:
 bool Delete(Microsoft::VisualStudio::Text::Span deleteSpan);
bool Delete(Microsoft::VisualStudio::Text::Span deleteSpan);
public bool Delete (Microsoft.VisualStudio.Text.Span deleteSpan);
abstract member Delete : Microsoft.VisualStudio.Text.Span -> bool
Public Function Delete (deleteSpan As Span) As Boolean

参数

deleteSpan
Span

要删除的字符的范围。

返回

Boolean

如果删除成功,则为 true ; 否则为false

例外

Apply() Cancel() Dispose() 之前已经对此对象调用了或方法。

deleteSpan.End 大于缓冲区的长度。

注解

删除空跨度将会成功,但不会生成新的快照,也不会引发 Changed 事件。

适用于

Delete(Int32, Int32)

从缓冲区中删除 equence 的字符。

public:
 bool Delete(int startPosition, int charsToDelete);
public:
 bool Delete(int startPosition, int charsToDelete);
bool Delete(int startPosition, int charsToDelete);
public bool Delete (int startPosition, int charsToDelete);
abstract member Delete : int * int -> bool
Public Function Delete (startPosition As Integer, charsToDelete As Integer) As Boolean

参数

startPosition
Int32

要删除的第一个字符的位置。

charsToDelete
Int32

要删除的字符数。

返回

Boolean

如果删除成功,则为 true ;如果被只读区域阻止,则为 false

例外

Apply() Cancel() Dispose() 之前已经对此对象调用了或方法。

startPosition小于零或大于缓冲区的长度,或 charsToDelete 小于零,或者 startPosition + charsToDelete 大于缓冲区的长度值。

注解

删除零个字符将会成功,但不会生成新的快照,也不会引发 Changed 事件。

适用于