private void comboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {         
            // if条件检测按下的是不是Enter键
            if(e.KeyChar == (char)13)  
            {
                if(!this.comboBox1.DroppedDown)
                {
                    this.comboBox1.DroppedDown = true;
                    e.Handled = true;
                }
            }
        }

    以上方法可以通过回车键和光标上下键,来实现comboBox的下拉一览和数据选择。

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2022-02-11
  • 2021-10-10
  • 2022-01-04
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-07-10
  • 2021-07-18
  • 2022-12-23
相关资源
相似解决方案