Bagikan melalui


SearchPane.PlaceholderText Properti

Definisi

Teks tempat penampung di kotak pencarian saat pengguna belum memasukkan karakter apa pun.

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

Nilai Properti

String

Platform::String

winrt::hstring

Teks tempat penampung untuk ditampilkan di kotak pencarian.

Atribut

Keterangan

Penting

Untuk mengimplementasikan pencarian di aplikasi untuk Windows 10 atau yang lebih baru, gunakan AutoSuggestBox. Lihat Kotak saran otomatis untuk informasi selengkapnya.

Anda tidak boleh menggunakan API Windows.ApplicationModel.Search (SearchPane, SearchContract) atau SEARCHBox API di aplikasi untuk Windows 10 atau yang lebih baru.

Catatan

Aplikasi tidak dapat menggunakan kotak pencarian (Windows.UI.Xaml.Controls.SearchBox/WinJS.UI.SearchBox) dan SearchPane. Menggunakan kotak pencarian dan panel pencarian di aplikasi yang sama menyebabkan aplikasi melemparkan pengecualian dengan pesan ini: "Tidak dapat membuat instans jenis 'Windows.UI.Xaml.Controls.SearchBox.'"

Anda dapat menggunakan teks tempat penampung untuk memberi pengguna indikasi tentang apa yang dapat dicarinya.

Jika teks tempat penampung terlalu panjang untuk dipaskan di kotak pencarian, sistem memotong teks tanpa menaikkan pengecualian.

Berlaku untuk

Lihat juga