| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 434 人关注过本帖
标题:[求助] 关于 Select Case 的问题
只看楼主 加入收藏
puridy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-2
收藏
 问题点数:0 回复次数:6 
[求助] 关于 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
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
你最好在标题上写VB
我一般都是用搜索功能找和VB有关的帖子。
2007-10-02 20:56
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
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 

为什么你看不出来问题出在“MIkey ”上?

非要赖在Select Case身上么。

2007-10-03 12:19
puridy
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-2
收藏
得分:0 
本人愚钝,还是找不到那出了错,为什么就7不行呢?
请版主说的具体点。
2007-10-03 20:21
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
2007-10-04 08:01
快速回复:[求助] 关于 Select Case 的问题
数据加载中...
 
   



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

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