请问如何在窗体内捕获键盘输入了方向键,请尽快帮忙

knetse 2005-11-18 08:09:14
方向键捕获是怎么实现的啊
...全文
203 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
northwolves 2005-11-18
  • 打赏
  • 举报
回复
???????


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyUp Then Me.Caption = "you clicked the “↑”"
If KeyCode = vbKeyDown Then Me.Caption = "you clicked the “↓”"
If KeyCode = vbKeyLeft Then Me.Caption = "you clicked the “←”"
If KeyCode = vbKeyRight Then Me.Caption = "you clicked the “→”"
End Sub

Private Sub Form_Load()
Me.KeyPreview = True
End Sub
rainstormmaster 2005-11-18
  • 打赏
  • 举报
回复
需要用子类实现

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧