I have a KixForm that I'd like to include an animated GIF on...essentially it would animate while a certain task is occurring. The animated GIF is in a PictureBox object.

I was hoping that I could do something like...

$Form1.Show
; Do a bunch of stuff
$Form1.Hide

But if you do it that way, the GIF doesn't animate. The only way I can get it to animate is to pass control to the form with

$Nul = Execute($Form1.DoEvents())

But once I do that, my script sits and waits for the form.

I'm looking for a way to do this so I can bring the form up (with animation), my script continues doing its thing, and then the form goes away when it's complete.

Can I attach some code to the form that will execute over and over and check for a file or something to know when it should close itself?