我使用命令
从mysql数据库中读取数据 vrijeme = myData.Item(2) ' translation vrijeme = time
ime = "Dobrodosli " & myData.Item(0) & "" ' translation ime = name
GameForma.Show()
之后我将vrijeme存储到文本框中
txtvrijeme.text = vrijeme
然后我在表单上添加计时器控件,并希望从文本框中的时间倒计时到0 .. 文本框中的时间格式为00:00:00
无论如何,如果有人想要帮助的话,整个项目都会在.rar中设置连接字符串和所有需要的东西 Dropbox:https://www.dropbox.com/s/maxmxeak0cr353q/PocetnaVerzija.rar
答案 0 :(得分:1)
解决方案是。从值
中读取数据 hours = txtTimefromDB.Text.Substring(0, 2)
minutes = txtTimefromDB.Text.Substring(3, 2)
sec = txtTimefromDB.Text.Substring(6, 2)
开始递减
Private Sub tmrCountdown_Tick(sender As Object, e As EventArgs) Handles tmrCountdown.Tick
sec = sec - 1
If sec = 0 Then
minutes = minutes - 1
sec = 60
ElseIf minutes = 0 Then
hours = hours - 1
minutes = 60
End If
txtTimefromDB.Text = "" & hours & ":" & minutes & ":" & sec
End Sub