我试图弄清楚如何在状态栏中合并进度条以显示完成了多少处理。下面是我更新进度条的示例(不确定这是否正确)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ToolStripProgressBar1.Value = ToolStripProgressBar1.Value + 2
If ToolStripProgressBar1.Value = 100 Then
ToolStripProgressBar1.Value = 0
ToolStripProgressBar1.Value = ToolStripProgressBar1.Value + 2
Timer1.Enabled = True
End If
End Sub
这是按钮内的代码。
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1Run.Click
ToolStripStatusLabel1.Text = "Processing..."
Timer1.Enabled = True
'more code to be inserted here
End Sub
我不确定如何根据您拥有的代码量更新进度条,一旦处理完成,更新ToolStripStatusLabel1
以显示“处理中......完成!”。