KeyDown,Up(F1,F2,F3 ......),请帮帮我 [英] KeyDown,Up (F1,F2,F3...), please help me

查看:102
本文介绍了KeyDown,Up(F1,F2,F3 ......),请帮帮我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何创建一个Sub Form_KeyDown,我需要设置F2,F2或者插入不是
TextBox或Controls事件,我需要创建一个Form_KeyDown

我正在使用这个但非常有效。


请帮助我

Private Sub Form_KeyDown(ByVal发送者As System.Object,ByVal e As

System.Windows.Forms.KeyEventArgs)处理MyBase.KeyDown


MsgBox(e.KeyCode)


结束子

How I can create an Sub Form_KeyDown, I need setup the F2, F2, or Insert not
the TextBox or Controls Event, I need create an Form_KeyDown
I was using this but dosent work.

Please help me
Private Sub Form_KeyDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

MsgBox(e.KeyCode)

End Sub

推荐答案

你好Juan,


你需要将Form的KeyPreview属性设置为True。 br />

问候,

Fergus
Hi Juan,

You need to set the KeyPreview property of the Form to True.

Regards,
Fergus


*" Fergus Cooney" <音响**** @ post.com> scripsit:
* "Fergus Cooney" <fi****@post.com> scripsit:
你需要将Form的KeyPreview属性设置为True。
You need to set the KeyPreview property of the Form to True.




_How_这样做?


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org/dotnet>


< http://www.plig.net/nnq/nquote.html> ;



_How_ to do that?

SCNR

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>


*" JuanCarlos Gomez" < JC ********* @ hotmail.com> scripsit:
* "JuanCarlos Gomez" <jc*********@hotmail.com> scripsit:
如何创建一个Sub Form_KeyDown,我需要设置F2,F2,或者不要插入TextBox或Controls事件,我需要创建一个Form_KeyDown
我是使用这个但非常有效。


我很确定,但也许您想将表格'''KeyPreview''

属性设置为''True''。

请帮帮我
Private Sub Form_KeyDown(ByVal sender As System.Object,ByVal e As
System.Windows.Forms.KeyEventArgs)处理MyBase.KeyDown

MsgBox(e.KeyCode)


\\\

如果e.KeyCode = Keys.F4那么

...

结束如果

///

End Sub
How I can create an Sub Form_KeyDown, I need setup the F2, F2, or Insert not
the TextBox or Controls Event, I need create an Form_KeyDown
I was using this but dosent work.
I am nort sure, but maybe you want to set the form''s ''KeyPreview''
property to ''True''.
Please help me
Private Sub Form_KeyDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

MsgBox(e.KeyCode)
\\\
If e.KeyCode = Keys.F4 Then
...
End If
///
End Sub




-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org / dotnet>


< http://www.plig.net/nnq/nquote.html>



--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>


这篇关于KeyDown,Up(F1,F2,F3 ......),请帮帮我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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