IncrementalSearch.StartBackward 方法
开始向后搜索。
命名空间: EnvDTE80
程序集: EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
Sub StartBackward
void StartBackward()
void StartBackward()
abstract StartBackward : unit -> unit
function StartBackward()
备注
开始朝着文档的开头进行渐进式搜索,如有必要则换行。
示例
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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。