【发布时间】:2017-01-19 09:44:30
【问题描述】:
我制作了一个在 Autodesk Inventor 中创建 3D 模型的应用程序。我想添加一个进度条来向用户显示该过程已经完成了多少。
我遇到的问题是,当 Autodesk Inventor 中的进程消耗大量 CPU 时,进度条没有显示所有步骤,而是跳转(例如进一步 5 步)到最后。
有没有办法强制 windows 窗体显示所有步骤?还是这种行为不常见?
Private Sub
' Display the ProgressBar control.
pbBuildProgress.Visible = True
' Set Minimum to 1 to represent the first file being copied.
pbBuildProgress.Minimum = 1
' Set Maximum to the total number of files to copy.
pbBuildProgress.Maximum = BodyComponents.Count
' Set the initial value of the ProgressBar.
pbBuildProgress.Value = 1
' Set the Step property to a value of 1 to represent each file being copied.
pbBuildProgress.Step = 1
' Start loop trough all body components
For i = 0 To BodyComponents.Count - 1
' Some code here that does stuff in Autodesk Inventor
' Perform a step
pbBuildProgress.PerformStep()
Next
End Sub
【问题讨论】:
标签: vb.net progress-bar