IncrementalSearch.DeleteCharAndBackup 方法

从搜索模式中移除一个字符,并将选定内容移回到上一个匹配项。

命名空间:  EnvDTE80
程序集:  EnvDTE80(在 EnvDTE80.dll 中)

语法

声明
Function DeleteCharAndBackup As vsIncrementalSearchResult
vsIncrementalSearchResult DeleteCharAndBackup()
vsIncrementalSearchResult DeleteCharAndBackup()
abstract DeleteCharAndBackup : unit -> vsIncrementalSearchResult 
function DeleteCharAndBackup() : vsIncrementalSearchResult

返回值

类型:EnvDTE80.vsIncrementalSearchResult
vsIncrementalSearchResult 枚举。

备注

DeleteCharAndBackup 对上一个搜索操作进行有效的反转。 移除该模式中的最后一个字符,将选定内容移动到上一个匹配项(与搜索方向无关)。

示例

Sub testIS2()
    ' Before running, open a document in Visual Studio.
    ' Set variables for text pane.
    Dim tp As EnvDTE80.TextPane2
    tp = CType(DTE.ActiveDocument.ActiveWindow.Object.ActivePane, _
    TextPane2)
    ' Start an incremental search backward from
    ' the current insertion point in the document.
    tp.IncrementalSearch.StartBackward()
    ' Add the character "a" to the search pattern.
    tp.IncrementalSearch.AppendCharAndSearch(Asc("a"))
    ' Display the parent name for IncrementalSearch object.
    MsgBox("IncrementalSearch parent: " & _
    tp.IncrementalSearch.DTE.FullName)
    MsgBox("Search pattern length: " & _
    tp.IncrementalSearch.Pattern.Length)
    ' Perform incremental search using the pattern ("a").
    tp.IncrementalSearch.SearchWithLastPattern()
    ' After the search, exit incremental search mode.
    MsgBox("DeleteCharAndBackup")
    tp.IncrementalSearch.DeleteCharAndBackup()
    MsgBox("SearchForward")
    tp.IncrementalSearch.SearchForward()
    MsgBox("SearchBackward")
    tp.IncrementalSearch.SearchBackward()
    MsgBox("Exit")
    tp.IncrementalSearch.Exit()
End Sub

.NET Framework 安全性

请参见

参考

IncrementalSearch 接口

EnvDTE80 命名空间

其他资源

How to: Search for Text Incrementally

How to: Search a Document Incrementally