次の方法で共有


SearchPane.PlaceholderText プロパティ

定義

ユーザーが文字を入力していない場合の検索ボックスのプレースホルダー テキスト。

public:
 property Platform::String ^ PlaceholderText { Platform::String ^ get(); void set(Platform::String ^ value); };
/// [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)]
/// [set: 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 PlaceholderText();

void PlaceholderText(winrt::hstring value);
/// [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")]
/// [set: 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 PlaceholderText();

void PlaceholderText(winrt::hstring value);
public string PlaceholderText { [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; [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))] set; }
public string PlaceholderText { [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; [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")] set; }
var string = searchPane.placeholderText;
searchPane.placeholderText = string;
Public Property PlaceholderText 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.' のインスタンスを作成できません"というメッセージでアプリが例外をスローします。

プレースホルダー テキストを使用して、検索できる内容をユーザーに示すことができます。

プレースホルダー テキストが長すぎて検索ボックスに収まらない場合は、例外を発生させることなくテキストが切り捨てられます。

適用対象

こちらもご覧ください