是的,我意识到这方面有很多事情,但它们对我不起作用。
        if (textBox1 != null)
        {
            string text = textBox1.Text;
            foreach (string s in apple)
            {
                if (s.Contains(text))
                {
                    listBox1.Items.Add(s);
                }
            }
        }
在列表框中,我有:“Bob”和“Joe”。文本框搜索名称,但如果我输入“joe”,那么它不会显示 joe 的名字,但是,如果我输入“Joe”,它会显示名字。