Skip to content

Commit a167621

Browse files
committed
Set progress bar visibility and update its value
Initialize progress bar as hidden and toggle visibility during task execution to reflect the process state. Ensure the progress bar value updates dynamically based on task progress.
1 parent f3bd08b commit a167621

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/Commas/Main.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public Main(Subtitle subtitle)
1616

1717
buttonOkay.DialogResult = DialogResult.OK;
1818

19+
progressBar1.Visible = false;
20+
1921
Closing += (sender, args) => { _ = CancelAndDisposeResources(); };
2022
}
2123

@@ -38,9 +40,12 @@ private async void buttonFixComma_Click(object sender, EventArgs e)
3840
{
3941
if (CancelAndDisposeResources())
4042
{
43+
progressBar1.Visible = false;
4144
return;
4245
}
4346

47+
progressBar1.Visible = true;
48+
4449
using var lmStudioClient = new LmStudioClient(textBoxEndPoint.Text, textBoxPrompt.Text);
4550

4651
// listView1.BeginUpdate();
@@ -58,6 +63,8 @@ private async void buttonFixComma_Click(object sender, EventArgs e)
5863
listView1.Refresh();
5964
previousPercentage = percentage;
6065
}
66+
67+
progressBar1.Value = item.index;
6168
});
6269

6370
try

0 commit comments

Comments
 (0)