 |
让程序在循环中响应键盘事件的办法是DOS的办法,在VB中已经没有意义了。应该使用KeyPress、KeyDown或KeyUp事件来做这个工作。每当用户按一个键就会发生一次这种事件。同时应该在你的循环中加上DoEvents,否则循环的时候,系统没有机会响应键盘事件。比如:
Do while express
statements
DoEvent
loop
Private Sub Form_KeyDown(keycode As Integer, shift As Integer)
If keycode = &h70 Then End
End Sub
此问题由李海、Eric 回答。
附加关键字:编程, 源程序, programming, source code, Visual Basic, VB, 键盘与鼠标, mouse, keyboard, hid。
|