标题:[求助] 关于 Select Case 的问题
取消只看楼主
puridy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-2
 问题点数:0 回复次数:3 
[求助] 关于 Select Case 的问题
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal Vkey As Long) As Integer
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
Dim n As Long
Dim KeyResult As Integer
Const TabKey = 9



'```````````````````````````````````````````````````````````````````````


Private Sub Timer1_Timer()
n = 49

Do Until n = 57
KeyResult = GetAsyncKeyState(n)

If KeyResult <> 0 Then


Select Case n

Case 49

MIkey ("nwcAthena")

Case 50

MIkey ("nwcThoth")

Case 51

MIkey ("nwcIsis")

Case 52

MIkey ("nwcHermes")
Case 53

MIkey ("nwcFafnir")

Case 54

MIkey ("nwcSacrificeToTheGods")

Case 55

MIkey ("nwcValkyries")



Case 56
MIkey ("nwcBlahBlah")

Case 57
MIkey ("nwcLancelot")

End Select
'
End If
n = n + 1
Loop

End Sub
'```````````````````````````````````````````````````````````````````````
Private Sub MIkey(Ajkey As String)
keybd_event TabKey, MapVirtualKey(TabKey, 0), 0, 0
Sleep 70
keybd_event TabKey, MapVirtualKey(TabKey, 0), 2, 0
SendKeys (Ajkey)
keybd_event 13, MapVirtualKey(13, 0), 0, 0
Sleep 70
keybd_event 13, MapVirtualKey(13, 0), 2, 0
End Sub



1~9 里面 就7没反应 ,我困惑了N天没找到问题出在那
搜索更多相关主题的帖子: Case Select 
2007-10-02 20:50
puridy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-2
得分:0 

哦,谢谢
我是第一次来

2007-10-02 21:04
puridy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-2
得分:0 
为什么没人 帮忙      
2007-10-03 10:42
puridy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-2
得分:0 
本人愚钝,还是找不到那出了错,为什么就7不行呢?
请版主说的具体点。
2007-10-03 20:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-174698-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.123593 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved