提供对文本编辑器的渐进式搜索 (ISearch) 功能的访问。
命名空间:  EnvDTE80
程序集:  EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
<GuidAttribute("C5BEE6D8-ED45-4317-96BF-97EB88EA3A07")> _
Public Interface IncrementalSearch
[GuidAttribute("C5BEE6D8-ED45-4317-96BF-97EB88EA3A07")]
public interface IncrementalSearch
[GuidAttribute(L"C5BEE6D8-ED45-4317-96BF-97EB88EA3A07")]
public interface class IncrementalSearch
[<GuidAttribute("C5BEE6D8-ED45-4317-96BF-97EB88EA3A07")>]
type IncrementalSearch =  interface end
public interface IncrementalSearch
IncrementalSearch 类型公开以下成员。
属性
| 名称 | 说明 | |
|---|---|---|
![]()  | 
DTE | 获取顶级扩展性对象。 | 
![]()  | 
IncrementalSearchModeOn | 获取一个值,该值指示是否正在执行 ISearch。 | 
![]()  | 
Pattern | 获取正在当前的 ISearch 中处理的字符。 | 
页首
方法
| 名称 | 说明 | |
|---|---|---|
![]()  | 
AppendCharAndSearch | 向 ISearch 模式添加一个字符并针对新字符串执行搜索。 | 
![]()  | 
DeleteCharAndBackup | 从搜索模式中移除一个字符,并将选定内容移回到上一个匹配项。 | 
![]()  | 
Exit | 停止当前的 ISearch 并将编辑器返回到其基本行为。 | 
![]()  | 
SearchBackward | 从当前位置到文档的开头搜索当前模式。 | 
![]()  | 
SearchForward | 从当前位置到文档的结尾搜索当前模式。 | 
![]()  | 
SearchWithLastPattern | 在不更改模式的情况下重复当前的 ISearch | 
![]()  | 
StartBackward | 开始向后搜索。 | 
![]()  | 
StartForward | 开始向前搜索。 | 
页首
示例
Sub testIS()
    ' Set variables for text pane.
    Dim tp As EnvDTE80.TextPane2
    tp = CType(DTE.ActiveDocument.ActiveWindow.Object.ActivePane, _
    TextPane2)
    ' Start an incremental search forward from
    ' the current insertion point in the document.
    tp.IncrementalSearch.StartForward()
    ' Add the character "a" to the search pattern.
    tp.IncrementalSearch.AppendCharAndSearch(Asc("a"))
    ' Perform incremental search using the pattern ("a").
    tp.IncrementalSearch.SearchWithLastPattern()
    ' After the search, exit incremental search mode.
    tp.IncrementalSearch.Exit()
End Sub
.gif)
.gif)