Quantcast
Channel: WP快站
Viewing all articles
Browse latest Browse all 233

PictureBox plays gif twice

$
0
0

I'm trying to create add a super simple animated gif to a PictureBox control in WinForms.

And I'm having this super weird issue, that the gif runs twice, even though the gif is created to only run once.

This is the code. I tried adding it through Resources and the Design window, same result.

    private string gif = AppDomain.CurrentDomain.BaseDirectory + @"resources\lock.gif";    public App()    {        InitializeComponent();        // picturebox is set to disabled in properties        pbxImage.ImageLocation = gif;        pbxImage.Load();        pbxImage.Enabled = true;    }

I was thinking this would be super simple, but I can't for the life of me figure out why. I'm relatively new to WinForms so I'm guessing there's something I'm missing.


Viewing all articles
Browse latest Browse all 233

Latest Images

Trending Articles