程序运行,单击开始每两秒输出一次shishu的值。当shishu的值达到9时输出“条件已成立”。代码如下:
Dim shishu As Integer
Private Sub Command1_Click()
Timer1.Interval = 2000
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Command1.Caption = "开始"
Command2.Caption = "退出"
shishu = 1
End Sub
Private Sub Timer1_Timer()
Form1.Cls
Print shishu
shishu = shishu + 1
If shishu = 9 Then
Print "条件已成立。"
Timer1.Interval = 0
End If
End Sub
最好用的是Microsoft visual studio 2008这款程序容易上手,并且很有实用价值
既然你是新手,最好买一本 编程指南 。看着本书容易上手
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)