Udostępnij za pośrednictwem


TextPane2.IncrementalSearch Property

Definition

Provides access to the incremental search (ISearch) capability of the text editor.

public:
 property EnvDTE80::IncrementalSearch ^ IncrementalSearch { EnvDTE80::IncrementalSearch ^ get(); };
public:
 property EnvDTE80::IncrementalSearch ^ IncrementalSearch { EnvDTE80::IncrementalSearch ^ get(); };
[System.Runtime.InteropServices.DispId(20)]
public EnvDTE80.IncrementalSearch IncrementalSearch { [System.Runtime.InteropServices.DispId(20)] get; }
[<System.Runtime.InteropServices.DispId(20)>]
[<get: System.Runtime.InteropServices.DispId(20)>]
member this.IncrementalSearch : EnvDTE80.IncrementalSearch
Public ReadOnly Property IncrementalSearch As IncrementalSearch

Property Value

An IncrementalSearch object.

Attributes

Examples

This example opens a text document, creates an IncrementalSearch object, and then searches for the character "t" in the text displayed on the text pane

Imports EnvDTE  
Imports EnvDTE80  
Sub TextPane2IncrementalSearchExample(ByVal dte As DTE2)  
    Dim objTW As TextWindow  
    Dim objPane As TextPane2  
    Dim objTextDoc As TextDocument  
    Dim objTextPt As TextPoint  
    Dim objEP As EditPoint  
    Dim incSearch As IncrementalSearch  
    ' Create a new text document.  
    _applicationObject.ItemOperations.NewFile("General\Text File")  
    ' Get a handle to the new document and create EditPoint,  
    ' TextPoint, and TextPane objects.  
    objTextDoc = CType(_applicationObject.ActiveDocument.Object _  
     ("TextDocument"), TextDocument)  
    objEP = objTextDoc.StartPoint.CreateEditPoint  
    objTextPt = objTextDoc.StartPoint  
    ' Plug in some text.  
    objEP.Insert("A test sentence.")  
    objTW = CType(dte.ActiveWindow.Object, TextWindow)  
    objPane = CType(objTW.ActivePane, TextPane2)  
    ' Create an incremental search object.  
    incSearch = objPane.IncrementalSearch  
    incSearch.StartForward()  
    MsgBox("Searching for a 't'.")  
    incSearch.AppendCharAndSearch(Asc("t"))  
    incSearch.Exit()  
End Sub  

Applies to