tags:

views:

72

answers:

2

I have an animated gif which I would like (It's a fancy animated gif) displayed over my form when a process is being executed. I cannot get the gif to show the underlying controls through it's transparent parts. I've tried using a picturebox but I don't think this can be set to transparent (It's background can, but not the actual object). This results in a grey square with the transparent animated gif showing only the underlying grey picturebox.

Is it possible to have a transparent gif over a form with no picturebox showing?

A: 

hope this helps: transparent-images-with- winforms

Tim Schmelter
A: 

Windows has limited support for transparency in child windows with the WS_EX_TRANSPARENT style flag. That works by Windows asking the parent of the control to draw itself to provide the background pixels. The problem is that you'll see the parent, not any controls that are overlapped by your picture box.

To make this work, you need to overlay another form on top. You can get it transparent with the TransparencyKey property. The code you'll need is available in my answer in this thread.

Hans Passant
Hi Hans,I don't think this will work with animated gifs?
madlan
It will work fine.
Hans Passant