1、想在一个单元格A中输入数字的时候,另一个单元格B的内容实时改变。原来用CellValueChanged,效果不太好,因为只能是在A中输入完了之后,再点一下别的地方(等A焦点完全消失),B才能改变;
2、有人说用KeyDown事件,我试了,可发现这个KeyDown是对于dataGridView响应的,也就是说当前焦点在dataGridView上面时,我按下键盘就会触发。
3、纠结中。
4、多指教!多谢!
2、有人说用KeyDown事件,我试了,可发现这个KeyDown是对于dataGridView响应的,也就是说当前焦点在dataGridView上面时,我按下键盘就会触发。
3、纠结中。
4、多指教!多谢!
解决方案 »
- .NET 网站程序,想对不同功能进行授权,有什么好的方法,如何实现?
- 关于C#客户端EXE隐藏的问题
- 请问Windows7中任务栏里实现的进度条怎么实现?
- 做了个cs的简单上传程序,出现中文文件名为乱码,怎么解决
- WebClient.UploadFile中的类似input的name写在什么地方?
- 关于messagebox的问题
- 有多少人关心Excel操作与打印?这里提供VB.Net、C#的使用方法及Web下导出Excel的解决方法...
- 帮忙了,谢谢@
- VS2013 C# 怎么才能调用DirectX 9的函数?
- 请教WebTreeView如何动态建立树!
- Server.MapPath在类中打不出来
- C#时间转换
public new bool ProcessRightKey(Keys keyData)
{
Keys key = (keyData & Keys.KeyCode);
if (key == Keys.Enter)
{
if ((base.CurrentCell.ColumnIndex == (base.ColumnCount - 1)) && (base.RowCount == 1))
{
base.CurrentCell = base.Rows[base.RowCount - 1].Cells[0];
return true;
}
if ((base.CurrentCell.ColumnIndex == (base.ColumnCount - 1)) && (base.CurrentCell.RowIndex < (base.RowCount - 1)))
{
base.CurrentCell = base.Rows[base.CurrentCell.RowIndex + 1].Cells[0];
return true;
} return base.ProcessRightKey(keyData);
}
return base.ProcessRightKey(keyData);
}
{
if (e.RowIndex > 0)
{
dataGridView1.CommitEdit(System.Windows.Forms.DataGridViewDataErrorContexts.Commit);
}
}
在CurrentCellDirtyStateChanged事件中,将CommitEdit()写了进去。
还请问下你写的ProcessRightKey函数作用是什么呢?我直接定义了cellValueChanged()事件了。
再次感谢你的思路!