MSDN Library

How to: Use the Animation Region of the Status Bar

 

The Animation region of the Visual Studio status bar displays a looping animation that indicates either a lengthy operation or an operation of indeterminate length (for example, building multiple projects in a solution).

To use the Animation region of the Visual Studio status bar

  1. Obtain an instance of the IVsStatusbar interface, which is made available through the SVsStatusbar service.

  2. Start the animation by calling the Animation method of the status bar. Pass in 1 as the value of the first parameter, and a reference to an animated icon as the value of the second parameter.

  3. Stop the animation by calling the Animation method of the status bar. Pass in 0 as the value of the first parameter, and a reference to the animated icon as the value of the second parameter.

Example

This example demonstrates how to run a built-in animation in the Animation region.

void AnimationExample()
{
    IVsStatusbar statusBar = 
        (IVsStatusbar)GetService(typeof(SVsStatusbar));
    object icon = 
        (short)Microsoft.VisualStudio.Shell.Interop.Constants.SBAI_General;

    // Display the animated Visual Studio icon in the Animation region.
    statusBar.Animation(1, ref icon);

    System.Windows.Forms.MessageBox.Show(
        "Click OK to end status bar animation.");

    statusBar.Animation(0, ref icon);
}
Show:
© 2016 Microsoft