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
Obtain an instance of the IVsStatusbar interface, which is made available through the SVsStatusbar service.
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.
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.
Private Property AnimationExample() As void
Dim statusBar As IVsStatusbar = CType(GetService(GetType(SVsStatusbar)), IVsStatusbar)
Dim icon As Object = CShort(Fix(Microsoft.VisualStudio.Shell.Interop.Constants.SBAI_General))
' Display the animated Visual Studio icon in the Animation region.
statusBar.Animation(1, icon)
System.Windows.Forms.MessageBox.Show("Click OK to end status bar animation.")
statusBar.Animation(0, icon)
End Property
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);
}
See Also
Concepts
How to: Read from and Write to the Feedback Region of the Status Bar