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的下拉一览和数据选择。
posted on 2007-10-19 17:02  PCJIM  阅读(1039)  评论(0编辑  收藏  举报