DataGridTextBoxColumn.TextBox的KeyPress事件怎么不能捕捉回车?
5420 2005-06-14 09:51:21 myTextBoxColumn = (DataGridTextBoxColumn)dataGrid1.TableStyles[0].GridColumnStyles[dataGrid1.CurrentCell.ColumnNumber];
myTextBoxColumn.TextBox.KeyPress +=new KeyPressEventHandler(TextBox_KeyPress);
private void TextBox_KeyPress(object sender, KeyPressEventArgs e)
{
MessageBox.Show(e.KeyChar.ToString());
if ( e.KeyChar ==(char)13 )
{
//按回车时
MessageBox.Show("Enter OK!");
}
}
其他键都可以捕捉到,但是敲却没有反应,哪位知道是什么原因啊?是不是回车被默认作其他用途了?在线等。。。谢谢!