VB编程, 如何实现按下回车时实现某按键触发事件?
2个回答
展开全部
请各位大侠帮忙.比如 密码框的输入,当输入完用户名和密码后,这时按下回车键就触发确定按钮!!如何编程实现? 满意答案Harrie5级2013-01-20Private Sub form_KeyPress(KeyAscii As Integer) '快捷键,前提form1.keypreview=ture If KeyAscii = 13 Then Call Command1_Click '按回车键(13)执行Command1_Click End If End Sub 补充: Private Sub Form_Load()
Me.KeyPreview = TrueEnd SubPrivate Sub form_KeyPress(KeyAscii As Integer) '快捷键,前提form1.keypreview=tureIf KeyAscii = 13 Then Call Command1_Click '按回车键(13)执行Command1_ClickEnd IfEnd Sub 其他回答(2)这女人不错。
Me.KeyPreview = TrueEnd SubPrivate Sub form_KeyPress(KeyAscii As Integer) '快捷键,前提form1.keypreview=tureIf KeyAscii = 13 Then Call Command1_Click '按回车键(13)执行Command1_ClickEnd IfEnd Sub 其他回答(2)这女人不错。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询