Can a PictureBox show animated GIF in Windows Application?

后端 未结 3 811
执念已碎
执念已碎 2020-11-29 06:48

I would like to show a animated gif in .Net Winform. How to do this?

I previously used VB 6.0.

3条回答
  •  没有蜡笔的小新
    2020-11-29 07:46

    I've played around with this and the animation plays provided that you don't perform another long running operation on the same thread. The moment you perform another long running operation, you'd want to do it in another thread.

    The simplest way to do this, is to use the BackgroundWorker component that you can drag onto the form from your toolbox. You'd then put your long running operation code in the DoWork() event of the BackgroundWorker. The final step would be to invoke your code by calling the RunWorkerAsync() method of the BackgroundWorker instance.

提交回复
热议问题