如何取消dataGridView中PreviewKeyDown事件里回车换行 我添加了一个PreviewKeyDown事件,想按下回车后只取出单元格中的内容后保持在原行而不换行怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这里可以采用投机取巧的办法,按回车他往下,那你给他发送一个向上的指令就可以了 private void dataGridView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (sender != null) { if (e.KeyCode == Keys.Enter) { DataGridView drvc = sender as DataGridView; if (drvc != null) { if (drvc.SelectedCells != null) { MessageBox.Show(drvc.SelectedCells[0].Value.ToString()); SendKeys.Send("{Up}"); } } } } } winform treeview控件半透明,控件上的字却无法显示 如何批量存入数据库 button的Clik事件不能有返回值的吗? 关于计算器的问题 请教一下关于 构造函数回传参数的问题 连接sql server的try{}catch怎么写 关于面向对象编程的思想 很急的一个问题,关于显示 MDI 子窗体 多个字符数组,返回什么类型比较好? 求助0.1~0.99这样小数的正则表达式 c#中清除picturebox画的图形 多条件查询,字符串拼接不成功!!
{
if (sender != null)
{
if (e.KeyCode == Keys.Enter)
{
DataGridView drvc = sender as DataGridView;
if (drvc != null)
{
if (drvc.SelectedCells != null)
{
MessageBox.Show(drvc.SelectedCells[0].Value.ToString());
SendKeys.Send("{Up}");
}
}
}
}
}