1个回答
2013-11-30
展开全部
对你的题目有点不太理解,是不是电子时钟如果是的话很简单的 ,用一个数组就可以窗体上按照下面的8字 放7个Line控件 是数组控件,数组下标从1到7,排放顺序按下面我画的那个放,顺序一定要放对 ,才能出效果,然后再放一下按钮控件Command1,按上断点击按钮就可以 实现从0到1的变换,然后 你就可以做个时钟了有什么不清楚的可以加我QQDim arrTime(9) As String
Private Sub Form_Load() ' 1
' *********
' * *
'6* *2
' * 7 *
' *********
' * *
'5* *3
' * *
' *********
' 4
arrTime(0) = "1,2,3,4,5,6"
arrTime(1) = "2,3"
arrTime(2) = "1,2,4,5,7"
arrTime(3) = "1,2,3,4,7"
arrTime(4) = "2,3,6,7"
arrTime(5) = "1,3,4,6,7"
arrTime(6) = "1,3,4,5,6,7"
arrTime(7) = "1,2,3"
arrTime(8) = "1,2,3,4,5,6,7"
arrTime(9) = "1,2,3,4,6,7"
End Sub Private Sub ShowNum(myNum As Integer)
Dim i As Integer
For i = 1 To 7
Line1(i).Visible = False
Next i
For i = 1 To 7
If InStr(arrTime(myNum), i) > 0 Then
Line1(i).Visible = True
End If
Next i
End Sub Private Sub Command1_Click()
Static i As Integer
ShowNum i
i = i + 1
If i > 9 Then i = 0
End Sub
Private Sub Form_Load() ' 1
' *********
' * *
'6* *2
' * 7 *
' *********
' * *
'5* *3
' * *
' *********
' 4
arrTime(0) = "1,2,3,4,5,6"
arrTime(1) = "2,3"
arrTime(2) = "1,2,4,5,7"
arrTime(3) = "1,2,3,4,7"
arrTime(4) = "2,3,6,7"
arrTime(5) = "1,3,4,6,7"
arrTime(6) = "1,3,4,5,6,7"
arrTime(7) = "1,2,3"
arrTime(8) = "1,2,3,4,5,6,7"
arrTime(9) = "1,2,3,4,6,7"
End Sub Private Sub ShowNum(myNum As Integer)
Dim i As Integer
For i = 1 To 7
Line1(i).Visible = False
Next i
For i = 1 To 7
If InStr(arrTime(myNum), i) > 0 Then
Line1(i).Visible = True
End If
Next i
End Sub Private Sub Command1_Click()
Static i As Integer
ShowNum i
i = i + 1
If i > 9 Then i = 0
End Sub
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询