一旦我开始运行任何代码,我的进度条就会消失。为什么? 那真的很奇怪。
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
StartThinking()
For Each z In ListBox1.Items
Dim u = FindIPAddress(z)
ListBox2.Items.Add(If(IsNothing(u), "Not found!", u))
Next
StopThinking()
End Sub
Sub StartThinking()
Cursor = Cursors.WaitCursor
ProgressBar1.Minimum = 0
ProgressBar1.Style = ProgressBarStyle.Marquee
End Sub
Sub StopThinking()
ProgressBar1.Minimum = ProgressBar1.Maximum
ProgressBar1.Style = ProgressBarStyle.Blocks
Cursor = Cursors.Arrow
End Sub