开发者

Stop Datagridview from taking its own action on Return Keypress

I have a winform datagridview and it forces the user to select by rows rather then cells.

I want it to tak开发者_StackOverflow中文版e the currentrow and display the information it has in another winform.

However when the user presses enter it moves to the next row and then runs the keypress event, why is it doing this and how can i get it to run before it changes the selected row?



try creating your class that inherits DataGridView and overridint method

protected override bool ProcessCmdKey( ref Message msg, Keys keyData )

int the method body check if the key is enter and than just do nothing and return true
Best Regards,
Iordan

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜