TextPane2.IncrementalSearch 屬性
提供文字編輯器累加搜尋 (ISearch) 功能的存取。
命名空間: EnvDTE80
組件: EnvDTE80 (在 EnvDTE80.dll 中)
語法
'宣告
ReadOnly Property IncrementalSearch As IncrementalSearch
IncrementalSearch IncrementalSearch { get; }
property IncrementalSearch^ IncrementalSearch {
IncrementalSearch^ get ();
}
abstract IncrementalSearch : IncrementalSearch with get
function get IncrementalSearch () : IncrementalSearch
屬性值
類型:EnvDTE80.IncrementalSearch
IncrementalSearch 物件。
範例
這個範例會開啟文字文件,並建立 IncrementalSearch 物件,然後再於文字窗格上顯示的文字中搜尋字元 "t"。 如需如何像執行增益集一般,執行這個範例的詳細資訊,請參閱 如何:編譯和執行 Automation 物件模型程式碼範例。
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
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。