我在程序中有一個計時器,計時器觸發進度條,當進度條完成時,它使標籤可見。問題在於標籤在進度條結束之前變得可見。這是我的代碼。Vb.net計時器不能像我想要的那樣工作
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If ComboBox1.SelectedItem = "Microsoft Office" Then
ProgressBar1.Visible = True
ProgressBar1.Increment(5)
End If
If ComboBox1.SelectedItem = "Windows 8" Then
ProgressBar1.Visible = True
ProgressBar1.Increment(1)
End If
If ComboBox1.SelectedItem = "Sony Vegas Pro 12.0" Then
ProgressBar1.Visible = True
ProgressBar1.Increment(10)
End If
If ComboBox1.SelectedItem = "Minecraft Premium" Then
ProgressBar1.Visible = True
ProgressBar1.Increment(20)
End If
If ProgressBar1.Value = ProgressBar1.Maximum Then
Timer1.Stop()
ProgressBar1.Value = 0
ProgressBar1.Visible = False
Button1.Visible = False
Button2.Visible = True
End If
If ComboBox1.SelectedItem = "Microsoft Office" Then
Label4.Visible = True
Exit Sub
End If
If ComboBox1.SelectedItem = "Windows 8" Then
Label5.Visible = True
Exit Sub
End If
If ComboBox1.SelectedItem = "Sony Vegas Pro 12.0" Then
Label6.Visible = True
Exit Sub
End If
If ComboBox1.SelectedItem = "Minecraft Premium" Then
Label7.Visible = True
Exit Sub
End If
End Sub
如果我能得到,爲什麼標籤出現應答之前的進度條變爲可見這將是偉大的!
WHICH標籤?你只是根據組合框的選擇設置了幾個,而不是**是否完成了步驟欄。順便說一句,combobox的選擇可能會改變滴答,也許看起來像一個bug取決於這是什麼 – Plutonix