I Have a Picturebox in WinForm I want when mouse go on Picturebox gif play once How can i do that?
Asked
Active
Viewed 1,098 times
-5
-
1Show us how far have you gone. Can you code the event? Can you start playing the gif? – Poody Nov 07 '16 at 07:40
-
checkout http://www.codeproject.com/Tips/1004624/Gif-viewer-Snipper-control – kashi_rock Nov 07 '16 at 07:42
-
no i have not i need code for play too – milad Nov 07 '16 at 07:43
1 Answers
0
How do you show animated GIFs on a Windows Form (c#) explains how to enable and disable animation. Create procedures for to enable and disable animation. Consider letting a different thread (Backgroundworker? or maybe async-await) do the animation
Create event handlers to react on MouseEnter and Mouse Leave and enable and disable the animation.
Most neat solution: Create a class AnimatedPictureBox derived from a picture box or a user control that has a picture box on it and let this class react on MouseEnter / MouseLeave. Advantage: code is reusable and you can use the designer to put the AnimatedPictureBox on your form

Community
- 1
- 1

Harald Coppoolse
- 28,834
- 7
- 67
- 116