DataGrid 的cell中如何响应回车的事件?

vc6delphi6 2003-01-22 04:37:38
DataGrid 的cell中如何响应回车的事件?
...全文
23 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
雪狼1234567 2003-09-11
  • 打赏
  • 举报
回复
5.30 How can I prevent the Enter key from moving to the next cell when the user is actively editing the cell and presses Enter?

Override the method ProcessKeyPreview in your DataGrid.



protected override bool ProcessKeyPreview(ref System.Windows.Forms.Message m)

{

Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode;

if((m.Msg == WM_KEYDOWN || m.Msg == WM_KEYUP)

&& keyCode == Keys.Enter )

return false;

return true;

}


wolve 2003-09-11
  • 打赏
  • 举报
回复
你说的是webform还是winform
zhulb 2003-09-11
  • 打赏
  • 举报
回复
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q902q
CNet 2003-01-22
  • 打赏
  • 举报
回复
无法响应的,俺是没有解决了。
有个折衷的办法:在需要相应回车的cell里add一个textbox就行了:)
titicaca 2003-01-22
  • 打赏
  • 举报
回复
你想干什么?说出来听听啊

110,549

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧