Windows Develop Bookmark and Share   
 index > Windows Forms General > Problems with gif image in tablelayout panel
 

Problems with gif image in tablelayout panel

I have a progress wheel gif image in a table layout panel

The gif image works fine (visible when required...)

Problem is gif image doesnot repaint when another window(notepad, another form etc) is hovered over it (not activating or deactivating it), The progress wheel stops ROTATING

I have used the tablelayout.layout event and have fired the tablelayout.Refresh() method. This takes care of rotating the progress wheel when the form is deactivated or sent to back etc

I only have problem when another window is dragged over it and beyond it

Any help would be appriciated

Thanks and Regards

Adit Malik

Adit Malik  Friday, March 28, 2008 3:18 PM

Adit,

Have you tried the following?

Code Snippet

PictureBox pbox;

public Form1()

{

ImageAnimator.Animate(pbox.Image, new EventHandler(onFrameChanged));

}

void onFrameChanged(object sender, EventArgs e)

{

ImageAnimator.UpdateFrames(pbox.Image);

}

Steve

яeverser  Friday, March 28, 2008 3:48 PM

I think ImageAnimator should do the trick...

http://msdn2.microsoft.com/en-us/library/system.drawing.imageanimator.aspx

Steve

яeverser  Friday, March 28, 2008 3:21 PM

Hi Steve,

As far as I know image Animater Is working in the background and is updating the GIF image

ie calling the paint event after some delay

But, I can't understand why it is not working in this case and how to fix it

PS: the gif image is rotating when the form is activated and is also rotating when form is deactivated (another form is selected)

Whats wrong is when another window/ form is hovered over it the gif image stops rotating

Thanks and Regards

Adit Malik

Adit Malik  Friday, March 28, 2008 3:33 PM

Adit,

Have you tried the following?

Code Snippet

PictureBox pbox;

public Form1()

{

ImageAnimator.Animate(pbox.Image, new EventHandler(onFrameChanged));

}

void onFrameChanged(object sender, EventArgs e)

{

ImageAnimator.UpdateFrames(pbox.Image);

}

Steve

яeverser  Friday, March 28, 2008 3:48 PM

You can use google to search for other answers

Custom Search

More Threads

• Adding Components to Windows Forms
• CheckedListBox question
• How do I prevent child form data from being passed back to parent?
• Insert text
• check to see if folder exists
• Question about UI Thread Invoking
• Setting IME mode off for controls
• Datagridview coloumnheader
• MDI parent and child
• Winform cold startup time in .Net 2