展开全部
顺序为
keydown
keyup
keypress
例:在窗体上建立一个文本框TextBox1,然后增加以下的事件处理代码;
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Print 1
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Print 2
End Sub
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Print 3
End Sub
然后运行窗孝核则体时在TextBox1文本框中敲一次键盘氏烂后,输出结果分别为1 2 3的顺序巧棚
keydown
keyup
keypress
例:在窗体上建立一个文本框TextBox1,然后增加以下的事件处理代码;
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Print 1
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Print 2
End Sub
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Print 3
End Sub
然后运行窗孝核则体时在TextBox1文本框中敲一次键盘氏烂后,输出结果分别为1 2 3的顺序巧棚
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询