Private Sub Command1_Click() '当按钮按下时发生
ClipboardClear '清空剪切板
ClipboardSetText Text1Text '文本框内容复制到剪切板中,我记着好像不用加括号
End Sub '结束过程
Dim a
'定义变量a,类型未定
If a Then Print a + "b" Else Print a + "a"
'If a Then 这句是条件表达式,如果 a =true 则执行打印 a+“b”
’否则则打印a + "a"
’由于没有给a赋值,a默认为空值。肯定会进入else的分支。
'至于为什么是a,那是因为 a+“a” 也就是empty值+字符串a,其结果肯定是a啦
对于些基础的知识,建议还是系统的看看教程,网上有很多的。
Private Sub Command1_Click()
MeCls
Dim N As Integer, i As Integer
N = InputBox("n=", , 9)
For i = 1 To 2 N - 1
If i <= N Then
Print Space(N - i) + String(2 i - 1, CStr(i))
Else
Print Space(N - (2 N - i)) + String(2 (2 N - i) - 1, CStr(2 N - i))
End If
Next i
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条)