注册 登录
编程论坛 VB6论坛

怎么设置按回车键等于按Tab键?

sunred 发布于 2008-08-04 11:12, 2366 次点击
在text1中输入数字后按回车跳到text2中输入……直到确定!
请大侠指点!谢谢!
7 回复
#2
flyingcat20082008-08-04 11:46
到text1的keypress中设置即可(看了别人的回复,应该回一声)
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If

End Sub

[[it] 本帖最后由 flyingcat2008 于 2008-8-4 12:02 编辑 [/it]]
#3
sunred2008-08-04 12:59
回复 2# flyingcat2008 的帖子
谢谢大哥,
还有一个问题,如果想设置回车键等于commond1_click怎么设置
#4
jxyga1112008-08-04 13:40
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
call command1_click
End If

End Sub
#5
sunred2008-08-04 14:56
回复 4# jxyga111 的帖子
谢谢啦!
#6
octillion2008-08-04 15:06
不是谢谢不谢谢的问题,在于你是否真正理解了。
#7
sunred2008-08-04 15:48
回复 6# octillion 的帖子
谢谢大哥关心,我理解了。回车键的KeyAscii 是13
#8
飞年合2013-11-23 20:28
怎么我用这个代码报错啊?有人能帮我看看不?
提示 D:\Web\eip\customs\frmCustomsManualReportAdd.aspx.vb(61): 'SetFocus' is not a member of 'System.Web.UI.WebControls.TextBox'.

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If

End Sub

1