Mdiform中的Keydown事件 [英] Keydown event in mdiform

查看:145
本文介绍了Mdiform中的Keydown事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个mdiform,我有一个绘图画布,现在我想在mdiform中添加keydown事件,我已经尝试过了,所以它可以在mdiform上工作,但是当我按mdiform上的画布时,它不起作用. ......

有没有解决办法的人然后答复我.......

hello guys,

i have one mdiform and in that i have a drawing canvas and now i want to add keydown event in mdiform i have tried it and so it work on mdiform but when i press on the canvas which is in mdiform it does''t work .......

does anyone having solution of this then reply me .......

推荐答案

System.Windows.Forms.Form中,活动控件将接收按键事件.因此,在上述情况下,当画布处于活动状态时,它可能正在接收KeyDown 事件.

若要使form 可以在事件传递到具有焦点的控件之前接收键事件,请按照以下说明http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx [^ ]
In System.Windows.Forms.Form the active control will receive the key events. Hence, in the above case when the canvas is active it may be receiving the KeyDown event.

To enable the form to receive the key events before the event is passed to the control that has focus, set the Form.KeyPreview property to true as explained here http://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx[^]


这篇关于Mdiform中的Keydown事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆