次の方法で共有


IncrementalSearch.DeleteCharAndBackup メソッド

検索パターンから 1 文字削除し、選択範囲を前回一致した項目に移動します。

名前空間:  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