Wayne 發問時間： 電腦與網際網路程式設計 · 2 0 年前

# Visual Basic

Public af

Private Sub Timer1_Timer()

a1\$ = Mid(Time\$, 1, 1)

Select Case a1\$

Case \"0\": a2\$ = \"1111110\"

Case \"1\": a2\$ = \"0110000\"

Case \"2\": a2\$ = \"1101101\"

Case \"3\": a2\$ = \"1111001\"

Case \"4\": a2\$ = \"0110011\"

Case \"5\": a2\$ = \"1011011\"

Case \"6\": a2\$ = \"1011111\"

Case \"7\": a2\$ = \"1110000\"

Case \"8\": a2\$ = \"1111111\"

Case \"9\": a2\$ = \"1111011\"

End Select

For i = 1 To 7

a3\$ = Mid(a2\$, i, 1)

If a3\$ = \"1\" Then

Label1(i - 1) = QBColor(11)

Label1(i - 1).BackColor = QBColor(11)

Else

Label1(i - 1) = QBColor(11)

End If

Next i

b1\$ = Mid(Time\$, 2, 1)

Select Case b1\$

Case \"0\": b2\$ = \"1111110\"

Case \"1\": b2\$ = \"0110000\"

Case \"2\": b2\$ = \"1101101\"

Case \"3\": b2\$ = \"1111001\"

Case \"4\": b2\$ = \"0110011\"

Case \"5\": b2\$ = \"1011011\"

Case \"6\": b2\$ = \"1011111\"

Case \"7\": b2\$ = \"1110000\"

Case \"8\": b2\$ = \"1111111\"

Case \"9\": b2\$ = \"1111011\"

End Select

For i = 1 To 7

b3\$ = Mid(b2\$, i, 1)

If b3\$ = \"1\" Then

Label2(i - 1) = QBColor(11)

Label2(i - 1).BackColor = QBColor(11)

Else

Label2(i - 1) = QBColor(11)

End If

Next i

c1\$ = Mid(Time\$, 4, 1)

Select Case c1\$

Case \"0\": c2\$ = \"1111110\"

Case \"1\": c2\$ = \"0110000\"

Case \"2\": c2\$ = \"1101101\"

Case \"3\": c2\$ = \"1111001\"

Case \"4\": c2\$ = \"0110011\"

Case \"5\": c2\$ = \"1011011\"

Case \"6\": c2\$ = \"1011111\"

Case \"7\": c2\$ = \"1110000\"

Case \"8\": c2\$ = \"1111111\"

Case \"9\": c2\$ = \"1111011\"

End Select

For i = 1 To 7

c3\$ = Mid(c2\$, i, 1)

If c3\$ = \"1\" Then

Label3(i - 1) = QBColor(11)

Label3(i - 1).BackColor = QBColor(11)

Else

Label3(i - 1) = QBColor(11)

End If

Next i

d1\$ = Mid(Time\$, 5, 1)

Select Case d1\$

Case \"0\": d2\$ = \"1111110\"

Case \"1\": d2\$ = \"0110000\"

Case \"2\": d2\$ = \"1101101\"

Case \"3\": d2\$ = \"1111001\"

Case \"4\": d2\$ = \"0110011\"

Case \"5\": d2\$ = \"1011011\"

Case \"6\": d2\$ = \"1011111\"

Case \"7\": d2\$ = \"1110000\"

Case \"8\": d2\$ = \"1111111\"

Case \"9\": d2\$ = \"1111011\"

End Select

For i = 1 To 7

d3\$ = Mid(d2\$, i, 1)

If d3\$ = \"1\" Then

Label4(i - 1) = QBColor(2)

Label4(i - 1).BackColor = QBColor(11)

Else

Label4(i - 1) = QBColor(0)

End If

Next i

End Sub

### 2 個解答

• ?
Lv 5
2 0 年前
最佳解答

模擬七段顯示器動作

很好奇為何相同動作不用回圈來作

迴圈中用IF就能過濾哪些數不作動作

• 7 年前

所以如果你想婚的念頭已經確定

就去找一家評價好一點的婚友社!

行動吧!

這是我之前參加的婚友社我覺得不錯

或搜尋 紅娘李姐