c# - c#我如何重置进程栏并重新启动它
问题描述
在 WFA (c#) 中,我有进程栏。我有 2 个进程,并且希望每次启动进程时都显示进程栏。但它不起作用!:
public void ProcessStart(int ProcessMaximumValue)
{
progressBar.Maximum = ProcessMaximumValue;
}
public void ProcessEnd()
{
progressBar.Value = 0;
}
ProcessStart(4);
for (int i = 1; i < 5; i++)
{
progressBar.PerformStep();
}
ProcessEnd();
ProcessStart(3);
for (int i = 1; i < 4; i++)
{
progressBar.PerformStep();
}
ProcessEnd();
解决方案
如果您的步长为 1,则需要将 设置为 1,例如:progressBar.Step = 1; PerformStep() 将 Step 值添加到 progress.value 上。
推荐阅读
- python - 如何检查字符串列是否包含子字符串,如果为真则返回行数据?
- python - 如何从 .txt 文件中读取某些字符并将它们写入 Python 中的 .csv 文件?
- python - 获取打开的每个文件的第一个、第二个和第三个日期 - Pandas
- php - 如何在没有 Bowser 的情况下禁用访问 url?
- java - Oracle Universal Installer 会弄乱我现有的数据库设置吗?
- logging - pytest-html:在使用日志记录时摆脱捕获日志中的 ASCII,因此它不显示详细信息链接?
- javascript - React 组件 JS 中的去抖动
- html - 首次加载或刷新后视频未播放
- python - Python:如何在打印函数中打印元组的单个元素
- java - 打印一条消息,说明元素不存在于 catch 块中,硒