Compartilhar via


Propriedade TextPane2.IncrementalSearch

Fornece acesso à pesquisa incremental (ISearch) a capacidade do editor de texto.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (em EnvDTE80.dll)

Sintaxe

'Declaração
ReadOnly Property IncrementalSearch As IncrementalSearch
IncrementalSearch IncrementalSearch { get; }
property IncrementalSearch^ IncrementalSearch {
    IncrementalSearch^ get ();
}
abstract IncrementalSearch : IncrementalSearch
function get IncrementalSearch () : IncrementalSearch

Valor de propriedade

Tipo: EnvDTE80.IncrementalSearch
Um objeto IncrementalSearch.

Exemplos

Este exemplo abre um documento de texto, cria um IncrementalSearch objeto e, em seguida, procura o caractere "t" no texto exibido no painel de texto.Para obter mais informações sobre como executar este exemplo como um add-in, consulte Como: compilar e executar os exemplos de código de modelo de objeto de automação.

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    TextPane2IncrementalSearchExample(_applicationObject)
End Sub
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

Segurança do .NET Framework

Consulte também

Referência

TextPane2 Interface

Namespace EnvDTE80