Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果您不知道总长度,您如何完美地遍历进度条。当我尝试这个时,我的循环首先结束,然后进度条就像 40%
for (int i = 0; i < files.Length; i++) { progressBar1.Value = i; Convert(files[i]); }
尝试设置
progressBar1.Maximum = files.Length;
在你的循环之前
MSDN - ProgressBar.Maximum