ComboBox.IsTextSearchEnabled プロパティ

定義

ユーザーが入力して値にジャンプできるかどうかを指定する値を取得または設定します。

public:
 property bool IsTextSearchEnabled { bool get(); void set(bool value); };
bool IsTextSearchEnabled();

void IsTextSearchEnabled(bool value);
public bool IsTextSearchEnabled { get; set; }
var boolean = comboBox.isTextSearchEnabled;
comboBox.isTextSearchEnabled = boolean;
Public Property IsTextSearchEnabled As Boolean
<ComboBox IsTextSearchEnabled="bool"/>

プロパティ値

Boolean

bool

ユーザー が入力して値にジャンプできる場合は true。それ以外の場合は false。 既定値は trueです。

Windows の要件

デバイス ファミリ
Windows 10 Anniversary Edition (10.0.14393.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v3.0 で導入)

注釈

Windows 10 バージョン 1607 以降、ComboBox にはテキスト検索機能が導入されています。 既定では、 ComboBox はユーザーが入力すると関連する値にジャンプします。 この動作を無効にするには、IsTextSearchEnabled プロパティを false に設定できます。 これは、カスタム テキスト検索で ComboBox を拡張した場合などに便利です。

バージョンの互換性

IsTextSearchEnabled プロパティは、バージョン 1607 Windows 10より前は使用できません。 Microsoft Visual Studio のアプリの "最小プラットフォーム バージョン" 設定が、このページの後半の 「要件」 ブロックに示されている "導入されたバージョン" より小さい場合は、これを考慮してアプリを設計してテストする必要があります。 詳細については、「 バージョン アダプティブ コード」を参照してください。

注意

テキスト検索機能は、アプリがWindows 10バージョン 1607 用にコンパイルされ、バージョン 1607 (以降) で実行されている場合に使用できます。 アプリが以前のバージョン用にコンパイルされている場合、または以前のバージョンで実行されている場合は使用できません。

以前のバージョンのWindows 10でアプリを実行するときに例外を回避するには、XAML でこのプロパティを設定したり、ランタイム チェックを実行せずに使用したりしないでください。 この例では、ApiInformation クラスを使用して、このプロパティを設定する前に、このプロパティの存在をチェックする方法を示します。

<ComboBox x:Name="comboBox1" Loaded="ComboBox_Loaded"/>
private void ComboBox_Loaded(object sender, RoutedEventArgs e)
{
    if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ComboBox", "IsTextSearchEnabled"))
    {
        comboBox1.IsTextSearchEnabled = false;
    }
}

適用対象