private void UpdateProgressBar(int value) { progressBar1.Value = value; // Update progress bar value progressBar1.Refresh(); // Redraw progress bar }
private void AnimateProgressBar() { progressBar1.Style = ProgressBarStyle.Marquee; // Set style to Marquee progressBar1.Refresh(); // Redraw progress bar }This example shows how to animate the progress bar using the Marquee style. The Refresh method is called to redraw the progress bar after the style has been set. Package library: System.Windows.Forms (part of the .NET Framework)