Loading...
Loading...
Implement Syncfusion ProgressBarAdv control in Windows Forms for displaying operation progress with customizable text formats. Use when creating progress indicators, loading bars, or percentage displays with Percentage, Value, or Custom text formats. Covers orientation (horizontal/vertical), themes, progress tracking, and progress events for file operations, installations, or download indicators.
npx skill4agent add syncfusion/winforms-ui-components-skills syncfusion-winforms-progress-barusing Syncfusion.Windows.Forms.Tools;
// Create ProgressBarAdv instance
ProgressBarAdv progressBarAdv1 = new ProgressBarAdv();
progressBarAdv1.Location = new Point(20, 20);
progressBarAdv1.Size = new Size(300, 30);
// Set range and value
progressBarAdv1.Minimum = 0;
progressBarAdv1.Maximum = 100;
progressBarAdv1.Value = 60;
// Configure text display
progressBarAdv1.TextStyle = ProgressBarTextStyles.Percentage;
progressBarAdv1.TextAlignment = TextAlignment.Center;
// Apply visual style
progressBarAdv1.ProgressStyle = ProgressBarStyles.Office2016Colorful;
// Add to form
this.Controls.Add(progressBarAdv1);// Display progress as percentage
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 45;
progressBar.TextStyle = ProgressBarTextStyles.Percentage;
progressBar.TextAlignment = TextAlignment.Center;
this.Controls.Add(progressBar);// Display custom text (e.g., "Loading...")
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 30;
progressBar.TextStyle = ProgressBarTextStyles.Custom;
progressBar.CustomText = "Loading files...";
progressBar.TextAlignment = TextAlignment.Center;
this.Controls.Add(progressBar);// Display current value out of maximum (e.g., "60/100")
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 60;
progressBar.TextStyle = ProgressBarTextStyles.Value;
progressBar.TextAlignment = TextAlignment.Center;
this.Controls.Add(progressBar);// Create vertical progress bar
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.ProgressOrientation = Orientation.Vertical;
progressBar.Size = new Size(50, 200);
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 75;
progressBar.TextStyle = ProgressBarTextStyles.Percentage;
this.Controls.Add(progressBar);// Apply theme and custom colors
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.ProgressStyle = ProgressBarStyles.Office2016Colorful;
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 50;
// Custom colors
progressBar.ForeColor = Color.Blue;
progressBar.BackColor = Color.LightGray;
// Text settings
progressBar.TextStyle = ProgressBarTextStyles.Percentage;
progressBar.TextAlignment = TextAlignment.Center;
this.Controls.Add(progressBar);// Create progress bar with event handling
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 0;
progressBar.TextStyle = ProgressBarTextStyles.Custom;
progressBar.CustomText = "Starting...";
// Subscribe to ValueChanged event
progressBar.ValueChanged += ProgressBar_ValueChanged;
this.Controls.Add(progressBar);
// Event handler
private void ProgressBar_ValueChanged(object sender, EventArgs e)
{
ProgressBarAdv pb = sender as ProgressBarAdv;
if (pb.Value < 100)
{
pb.CustomText = $"Processing... {pb.Value}%";
}
else
{
pb.CustomText = "Complete!";
}
}// Simulate a long-running operation with progress updates
private async void StartOperation()
{
ProgressBarAdv progressBar = new ProgressBarAdv();
progressBar.Location = new Point(20, 20);
progressBar.Size = new Size(400, 30);
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.Value = 0;
progressBar.TextStyle = ProgressBarTextStyles.Percentage;
progressBar.ProgressStyle = ProgressBarStyles.Office2016Colorful;
this.Controls.Add(progressBar);
// Simulate operation
for (int i = 0; i <= 100; i += 10)
{
progressBar.Value = i;
await Task.Delay(500); // Simulate work
}
MessageBox.Show("Operation complete!");
}| Property | Type | Description |
|---|---|---|
| | Current progress value |
| | Minimum progress value (default: 0) |
| | Maximum progress value (default: 100) |
| | Text format: Percentage, Value, Custom |
| | Custom text to display (when TextStyle = Custom) |
| | Text alignment: Left, Center, Right |
| | Horizontal or Vertical orientation |
| | Visual style: Office2016Colorful, Tube, Gradient, etc. |
| | Enable theme support |
| | Foreground/progress color |
| | Background color |
| | Background style options |
| Event | Description |
|---|---|
| Occurs when the Value property changes |
| Allows custom rendering of waiting gradient |
| TextStyle | Display Format | Example |
|---|---|---|
| Shows percentage | "60%" |
| Shows value/max | "60/100" |
| Shows CustomText | "Loading..." |
| ProgressStyle | Description |
|---|---|
| Vibrant Office 2016 theme with blue accents |
| Clean, light Office 2016 theme |
| Medium-dark Office 2016 theme |
| High-contrast dark Office 2016 theme |
| Standard Windows system style |
| Tube-style progress indicator |
| Gradient progress effect |