SearchPane.QueryText プロパティ

定義

検索ウィンドウの検索ボックス内の現在のテキスト。

public:
 property Platform::String ^ QueryText { Platform::String ^ get(); };
/// [get: Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.ApplicationModel.Search.SearchContract)]
winrt::hstring QueryText();
/// [get: Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.ApplicationModel.Search.SearchContract")]
winrt::hstring QueryText();
public string QueryText { [Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.ApplicationModel.Search.SearchContract))] get; }
public string QueryText { [Windows.Foundation.Metadata.Deprecated("ISearchPane may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.ApplicationModel.Search.SearchContract")] get; }
var string = searchPane.queryText;
Public ReadOnly Property QueryText As String

プロパティ値

String

Platform::String

winrt::hstring

現在のクエリ テキスト。 検索ウィンドウが使用されていない場合、これは空の文字列です。

属性

注釈

重要

Windows 10以降の検索をアプリに実装するには、AutoSuggestBox を使用します。 詳細については、「 自動提案ボックス 」を参照してください。

Windows 10 以降のアプリでは、Windows.ApplicationModel.Search API (SearchPaneSearchContract) または SearchBox API を使用しないでください。

Note

アプリでは、検索ボックス (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) と SearchPane の両方を使用することはできません。 同じアプリで検索ボックスと検索ウィンドウの両方を使用すると、"型 'Windows.UI.Xaml.Controls.SearchBox.' のインスタンスを作成できません"というメッセージでアプリが例外をスローします。

検索ウィンドウが開いていない場合でも、クエリ テキストはいつでも取得できます。

適用対象

こちらもご覧ください