BindingSource.SupportsSearching プロパティ

定義

データ ソースが、Find(PropertyDescriptor, Object) メソッドを使用した検索をサポートしているかどうかを示す値を取得します。

public:
 virtual property bool SupportsSearching { bool get(); };
[System.ComponentModel.Browsable(false)]
public virtual bool SupportsSearching { get; }
[<System.ComponentModel.Browsable(false)>]
member this.SupportsSearching : bool
Public Overridable ReadOnly Property SupportsSearching As Boolean

プロパティ値

リストが IBindingList で、Find メソッドを使用した検索をサポートしている場合は true。それ以外の場合は false

実装

属性

次のコード例は、 メンバーの使用方法を SupportsSearching 示しています。 完全な例については、クラスの概要に関するトピックを参照してください。

private void button1_Click(object sender, EventArgs e)
{
    if (binding1.SupportsSearching != true)
    {
        MessageBox.Show("Cannot search the list.");
    }
    else
    {
        int foundIndex = binding1.Find("Name", textBox1.Text);
        if (foundIndex > -1)
            listBox1.SelectedIndex = foundIndex;
        else
            MessageBox.Show("Font was not found.");
    }
}
    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
        Handles button1.Click

        If binding1.SupportsSearching <> True Then
            MessageBox.Show("Cannot search the list.")
        Else
            Dim foundIndex As Integer = binding1.Find("Name", textBox1.Text)
            If foundIndex > -1 Then
                listBox1.SelectedIndex = foundIndex
            Else
                MessageBox.Show("Font was not found.")
            End If
        End If

    End Sub
End Class

注釈

データ ソースが でない場合は、常に をIBindingListSupportsSearching返しますfalse

適用対象