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 展开
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 展开
3个回答
展开全部
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
'上述代码运行正常,无错误。
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
'上述代码运行正常,无错误。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
写的什么错误啊,感觉像是窗体没有控件
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你的窗体放了timer1控件了吗?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询