winForm中combobox如何点击回车弹出下拉列表 在按键里判断是不明是回车键,然后combobox1.DroppedDown=true; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) comboBox1.DroppedDown = true; } 楼上的方法好像不行。这样可以: [DllImport("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); const int CB_SHOWDROPDOWN = 0x014F; const int CB_GETDROPPEDSTATE = 0x0157; private void comboBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { SendMessage(comboBox1.Handle, CB_SHOWDROPDOWN, 1, 0); e.Handled = true; } } 我想问下,如果combobox是在dataGridView中的,应该怎么用啊 if (e.KeyCode == Keys.Enter&& comboBox1.DroppedDown == false) { e.Handled = true; SendKeys.SendWait("{F4}"); } private void comboBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) comboBox1.DroppedDown = true; } dataGridView通过重绘合并单元格的问题 碰到一个关于继承的一个问题!?在线等待 上传文件 在服务器上路径设置,急急,, Timer控件的使用?不用事件触发如何自动执行一次? 不能中断,无法调试 如何求任何一个二叉树的完全二叉树的部分的深度啊?????在线等~~~ 未知sql查询语句的情况下怎么获得这条语句访问的表名? 参数不足,期待是1,这是什么错误?请指教。 C# DataGridViewComboBoxColumn单击无数据显示 怎么添加tablestyles引用,web页面下——在线等 反射时用字符串作为类型进行强制转换——高手进 如何判断是com组件还是一般的组件
private void comboBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Return)
comboBox1.DroppedDown = true;
}
const int CB_SHOWDROPDOWN = 0x014F;
const int CB_GETDROPPEDSTATE = 0x0157; private void comboBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendMessage(comboBox1.Handle, CB_SHOWDROPDOWN, 1, 0);
e.Handled = true;
}
}
{ e.Handled = true;
SendKeys.SendWait("{F4}");
}
{
if (e.KeyChar == (char)Keys.Return)
comboBox1.DroppedDown = true;
}