VB数字秒表程序 Timer1.Enabled = False错误 5

DimaDimiAsInteger,jAsIntegerConstpi=3.1415926PrivateSubCommand1_Click()Timer1.Enabled... Dim a
Dim i As Integer, j As Integer
Const pi = 3.1415926
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
If Command2.Caption = "停止" Then
Timer1.Enabled = False
Command2.Caption = "继续"
Else
Timer1.Enabled = True
Command2.Caption = "停止"
End If
End Sub
Private Sub Command3_Click()
Line1.X2 = 0: Line1.Y2 = 1.2
a = pi / 2
Timer1.Enabled = False
i = 0: j = 0
Text1.Text = ""
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
Picture1.Scale (-2, 2)-(2, -2)
Line1.X1 = 0: Line1.Y1 = 0
Line1.X2 = 0: Line1.Y2 = 1.2
a = pi / 2
End Sub
Private Sub Timer1_Timer()
If i > 60 Then
i = 0
j = j + 1
Else
i = i + 1
End If
a = a - pi / 30
Line1.X2 = 1.2 * Cos(a)
Line1.Y2 = 1.2 * Sin(a)
Text1.Text = Format(j, "00") & " : " & Format(i, "00")
End Sub
展开
 我来答
sxqiufeng
2013-05-15 · TA获得超过644个赞
知道小有建树答主
回答量:647
采纳率:100%
帮助的人:493万
展开全部
Dim a
Dim i As Integer, j As Integer
Const pi = 3.1415926
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
If Command2.Caption = "停止" Then
Timer1.Enabled = False
Command2.Caption = "继续"
Else
Timer1.Enabled = True
Command2.Caption = "停止"
End If
End Sub
Private Sub Command3_Click()
Line1.X2 = 0: Line1.Y2 = 1.2
a = pi / 2
Timer1.Enabled = False
i = 0: j = 0
Text1.Text = ""
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
Picture1.Scale (-2, 2)-(2, -2)
Line1.X1 = 0: Line1.Y1 = 0
Line1.X2 = 0: Line1.Y2 = 1.2
a = pi / 2
End Sub
Private Sub Timer1_Timer()
If i > 60 Then
i = 0
j = j + 1
Else
i = i + 1
End If
a = a - pi / 30
Line1.X2 = 1.2 * Cos(a)
Line1.Y2 = 1.2 * Sin(a)
Text1.Text = Format(j, "00") & " : " & Format(i, "00")
End Sub
'上述代码运行正常,无错误。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
孤辰雨bV
2013-05-15 · 超过28用户采纳过TA的回答
知道答主
回答量:247
采纳率:0%
帮助的人:59.5万
展开全部
写的什么错误啊,感觉像是窗体没有控件
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
网海1书生
科技发烧友

2013-05-15 · 擅长软件设计、WEB应用开发、小程序
网海1书生
采纳数:12311 获赞数:26231

向TA提问 私信TA
展开全部
你的窗体放了timer1控件了吗?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式