新建一个文本框Text1,Text属性为空,MultiLine属性为True,ScrollBars属性为2。
新建一个命令按钮Command1,添加以下代码:
Private
Sub
Command1_Click()
Dim
i
As
Integer
For
i
=
1
To
100
If
(i
Mod
5
=
0)
And
(i
Mod
3
<>
0)
Then
Text1Text
=
Text1Text
&
vbCrLf
&
i
Next
End
Sub
Private Sub Command1_Click()
Dim i As Integer
For i = 0 To 10
Presskey i
Next
End Sub
Private Sub Presskey(Index As Integer)
Dim t As Single
t = Timer
Do Until Timer - t - 05 > 0
DoEvents
Loop
Select Case Index
Case 0
SendKeys " " '空格键
Case 1
SendKeys "{DOWN}" '方向键下
Case 2
SendKeys "{ENTER}" '回车键
Case 3
SendKeys "{LEFT}" '方向左
Case 4
SendKeys "{LEFT}" '方向左
Case 5
SendKeys "{ENTER}" '回车键
Case 6
SendKeys "{ENTER}" '回车键
Case 7
SendKeys " " '空格键
Case 8
SendKeys " " '空格键
Case 9
SendKeys " " '空格键
Case 10
SendKeys "{ESC}" 'ESC
End Select
End Sub
欢迎分享,转载请注明来源:浪漫分享网
评论列表(0条)