回车键 [英] Enter key

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

问题描述

如何设置回车键从一个字段移动到另一个字段?

How do you set the enter key to move from one field to
another field?

推荐答案

" Claudie Bouzy <一个******* @ discussions.microsoft.com> schrieb
"Claudie Bouzy" <an*******@discussions.microsoft.com> schrieb
如何设置enter键从一个字段移动到另一个字段?
How do you set the enter key to move from one field to
another field?




设置表单'' s keypreview property = True并处理Form'的按键

事件。

-

Armin



Set the Form''s keypreview property = True and handle the Form''s keypress
event.
--
Armin


" Armin Zingler" < AZ ******* @ freenet.de> schrieb
"Armin Zingler" <az*******@freenet.de> schrieb
" Claudie Bouzy" <一个******* @ discussions.microsoft.com> schrieb
"Claudie Bouzy" <an*******@discussions.microsoft.com> schrieb
如何设置回车键从一个字段移动到另一个字段?
How do you set the enter key to move from one field to
another field?



设置表单的keypreview属性=真实并处理Form'的
按键事件。



Set the Form''s keypreview property = True and handle the Form''s
keypress event.




我忘了:在事件处理程序中,调用SelectNextControl:

Private Sub Form1_KeyDown(_

ByVal sender As Object,_

ByVal e As System.Windows.Forms.KeyEventArgs)_

处理MyBase。 KeyDown


如果e.KeyCode = Keys.Enter那么

Me.SelectNextControl(_

Me.ActiveControl,True,True ,真实,真实_



e.Handled = True

结束如果


结束Sub

-

Armin



I forgot: In the event handler, call SelectNextControl:
Private Sub Form1_KeyDown( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles MyBase.KeyDown

If e.KeyCode = Keys.Enter Then
Me.SelectNextControl( _
Me.ActiveControl, True, True, True, True _
)
e.Handled = True
End If

End Sub
--
Armin


*" Claudie Bouzy" <一个******* @ discussions.microsoft.com> scripsit:
* "Claudie Bouzy" <an*******@discussions.microsoft.com> scripsit:
如何设置回车键从一个字段移动到另一个字段?
How do you set the enter key to move from one field to
another field?




为什么使用非标准行为?!


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

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



Why use non-standard behavior?!

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


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

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