Here is an out of box idea I have tried. Not sure if it will work for you !! I am trying to learn Windows Presentation Foundation(WPF) and tried this trick based on it. WPF supports animation in big way, but a steep learning curve.
- Create a text document. Copy and paste the below code, save and close. Change the file extension from .txt to .xaml. Try to open this .xaml file using Internet Explorer. If it shows color changes from red to blue and back, it is working correctly.
Code:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DockPanel >
<Rectangle Name="Rect" Fill="Red" >
<Rectangle.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<ColorAnimation Storyboard.TargetProperty="Fill.Color" From="Red" To="Blue" Duration="0:0:2.0" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</DockPanel>
</Page>
- Create a form (say frmAnimation), add a Web Browser control to it. Set its control source to this xaml file you saved.
- Open this form as a hidden form when you load the form that is running your other code.This is required to avoid the delay till the animation starts.
- Just before you start the code to save/manipulate data, make this form visible and hide again when code finishes execution.
- Close frmAnimation just before you close your main form.
The color animation will run infinitely and independent of your other code.
I have used a simple animation of color changing rectangles. You can tweak the animation by editing the xaml file and test it by opening it in Internet Explorer.
Happy coding !!