---
title: "Introducing Busy Indicator in Windows Forms"
published_at: "2018-08-21T12:00:00+00:00"
modified_at: "2026-02-10T09:52:42+00:00"
url: "https://www.syncfusion.com/blogs/post/introducing-busy-indicator-in-windows-forms"
excerpt: "We are excited to introduce the busy indicator drawing helper for Windows Forms. This busy indicator drawing helper has been implemented in our 2018 Volume 2 release. Usually, an animated GIF image cannot be shown in a Windows Forms control..."
taxonomy_category:
  - "Desktop"
  - "Development"
  - "Essential Studio"
  - "Syncfusion"
  - "Windows Forms"
taxonomy_post_tag:
  - "animated GIF"
  - "BackgroundWorker"
  - "Busy Indicator"
  - "busyindicator"
  - "development"
  - "drawing helper"
  - "Essential Studio"
  - "pixture box control"
  - "Syncfusion"
  - "Windows Forms"
---

# Introducing Busy Indicator in Windows Forms

[Neelakandan Kannan](https://www.syncfusion.com/blogs/author/neelakandan-kannan)

![Image](https://www.syncfusion.com/blogs/wp-content/uploads/2018/08/blogThumbnail_febbf9b3.png)


We are excited to introduce the busy indicator drawing helper for Windows Forms. This busy indicator drawing helper has been implemented in our 2018 Volume 2 release. Usually, an animated [GIF](https://en.wikipedia.org/wiki/GIF)
 image cannot be shown in a Windows Forms control without using the [picture box](https://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox(v=vs.110).aspx)
 control or writing our own custom control. The busy indicator drawing helper helps you show animated GIF images in a control. The main advantage of this helper is that you can use it in any Windows Forms control, regardless of whether it is a Syncfusion control.

This blog explores how you can show animated GIF images using the busy indicator drawing helper in Windows Forms controls.

## Getting started

Busy indicator is available in Syncfusion.Core.WinForms assembly. Refer to the [control dependencies](https://help.syncfusion.com/windowsforms/control-dependencies)
 section to learn how to add an assembly reference to your application. [BusyIndicator](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.Core.Utils.BusyIndicator.html)
 class provides the option to show an animated GIF image in the control. The [Show](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.Core.Utils.BusyIndicator.html#Syncfusion_WinForms_Core_Utils_BusyIndicator_Show_System_Windows_Forms_Control_)
 method can be used to show the GIF image. By default, busy indicator shows the built-in GIF image. You can change the GIF image using the [Image](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.Core.Utils.BusyIndicator.html#Syncfusion_WinForms_Core_Utils_BusyIndicator_Image)
 property or [Show](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.Core.Utils.BusyIndicator.html#Syncfusion_WinForms_Core_Utils_BusyIndicator_Show_System_Windows_Forms_Control_System_Drawing_Image_)
 method.

Let’s see an example for showing the busy indicator in the [button](https://help.syncfusion.com/windowsforms/button/overview)
 control. I’m going to show the busy indicator when a button is clicked, before an iteration gets started, and then hide it once the iteration gets completed.

```
public partial class Form1 : Form
{
    BusyIndicator busyIndicator = new BusyIndicator();
    ObservableCollection<int> sampleData = new ObservableCollection<int>();
    public Form1()
    {
        InitializeComponent();           
    }
    
    private void sfButton1_Click(object sender, EventArgs e)
    {
        this.sfButton1.Text = string.Empty;
        busyIndicator.Show(this.sfButton1);
        for (int i = 0; i <= 10000000; i++)
        {
            sampleData.Add(i);
        }
        busyIndicator.Hide();
        this.sfButton1.Text = "Get items";
        sampleData.Clear();
    }
}   
```

![Image](https://blog.syncfusion.com/wp-content/uploads/2018/08/image-97.gif)

## Showing busy indicator in a different location

By default, the GIF image will be shown at the center of the control. It’s easy to move the busy indicator to any location in the control, though. This can be done using the [Location](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.Core.Utils.BusyIndicator.html#Syncfusion_WinForms_Core_Utils_BusyIndicator_Location)
 property or [Show](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.Core.Utils.BusyIndicator.html#Syncfusion_WinForms_Core_Utils_BusyIndicator_Show_System_Windows_Forms_Control_System_Drawing_Point_)
 method.

```
public partial class Form1 : Form
{
    BusyIndicator busyIndicator = new BusyIndicator();
    ObservableCollection<int> sampleData = new ObservableCollection<int>();
    public Form1()
    {
        InitializeComponent();           
    }
    
    private void sfButton1_Click(object sender, EventArgs e)
    {
        this.sfButton1.Text = "Loading";
        busyIndicator.Show(this.sfButton1, new Point((this.sfButton1.Width / 2) + this.busyIndicator.Image.Width, (this.sfButton1.Height / 2) - this.busyIndicator.Image.Height / 2));
        for (int i = 0; i <= 10000000; i++)
        {
            sampleData.Add(i);
        }
        busyIndicator.Hide();
        this.sfButton1.Text = "Get items";
        sampleData.Clear();
    }
}
```

![Image](https://blog.syncfusion.com/wp-content/uploads/2018/08/image-98.gif)

The sample can be downloaded from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/BusyIndicatorHelperSample-141754606.zip)
.

## Showing busy indicator in asynchronous mode

Busy indicator can be shown asynchronously in a control by handling the [BackgroundWorker](https://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker(v=vs.110).aspx)
. The busy indicator can be shown when BackgroundWorker’s [DoWork](https://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.dowork(v=vs.110).aspx)
 starts and can be hidden when BackgroundWorker’s [RunWorkerCompleted](https://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.runworkercompleted(v=vs.110).aspx)
 is completed.

```
BackgroundWorker backgroundWorker = new BackgroundWorker();
BusyIndicator busyIndicator = new BusyIndicator();
ObservableCollection<int> sampleData = new ObservableCollection<int>();
public Form1()
{   
    InitializeComponent();           
    backgroundWorker.WorkerSupportsCancellation = true;
    backgroundWorker.DoWork += DoWork;
    backgroundWorker.RunWorkerCompleted += RunWorkerCompleted;
}

private void DoWork(object sender, DoWorkEventArgs e)
{
    this.sfButton1.Invoke(new Action(() => this.sfButton1.Text = string.Empty));
    busyIndicator.Show(this.sfButton1);
    for (int i = 0; i <= 10000000; i++)
    {
        sampleData.Add(i);
    }            
}

private void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
    this.sfButton1.Text = "Get items";
    if (!backgroundWorker.IsBusy)
        backgroundWorker.CancelAsync();
    busyIndicator.Hide();
    sampleData.Clear();
}

private void sfButton1_Click(object sender, EventArgs e)
{
    backgroundWorker.RunWorkerAsync();
}
```

![Image](https://blog.syncfusion.com/wp-content/uploads/2018/08/image-99.gif)

The sample can be downloaded from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Asynchronous_BusyIndicator16131033.zip)
.

## Built-in busy indicator in data grid

Our new data grid has built-in busy indicator support for large data operations such as data loading, grouping, sorting, and filtering. Refer to [this documentation](https://help.syncfusion.com/windowsforms/datagrid/styling#showing-busy-indicator-for-the-data-operations)
 to learn more about this support.

![Image](https://blog.syncfusion.com/wp-content/uploads/2018/08/image-100.gif)

## Summary

In this blog, we hope you enjoyed learning how to show the busy indicator in a Windows Forms control. You can also refer to this documentation to learn about additional options provided in the busy indicator. If you’re already a Syncfusion user, you can download the Windows Forms setup on [Direct-Trac](https://www.syncfusion.com/support/directtrac/downloads/16_2_0_41?file=windowsforms)
. If you’re not yet a Syncfusion user, you can download a free, 30-day trial on our website. Give us your feedback in the comments section below, our [online forum](https://www.syncfusion.com/forums/windowsforms)
, or a [support ticket.](https://www.syncfusion.com/support/directtrac/incidents/newincident)

*If you like this blog post, we think you’ll also like the following free e-books:*

*[Windows 8.1 Succinctly](https://www.syncfusion.com/ebooks/windows8.1)
  
 [Windows Azure SQL Reporting Succinctly](https://www.syncfusion.com/ebooks/windowsazure)
  
 [Windows Store Apps Succinctly](https://www.syncfusion.com/ebooks/windowsstoreapps)*
