How can I run an animated gif in VB?
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 'Controls - How can I run an animated gif in VB? 'You can use a Webbrowser control within a Picturebox to fake an Animated Gif box.. 'Place a Webbrowser Control within a Picturebox, so the Picturebox is the Container, 'for this example also place a CommonDialogBox on the Form: Private Sub Command1_Click() On Error GoTo Load_Cancel With CommonDialog1 .CancelError = True .DialogTitle = "Open an Animated GIF" .Filter = "GIFS (*.GIF)|*.GIF" .ShowOpen WebBrowser1.Navigate .FileName WebBrowser1.Move ScaleX(-12, vbPixels, vbTwips), ScaleY(-19, vbPixels, vbTwips), _ Width, Height Picture1 = LoadPicture(.FileName) Picture1.AutoSize = True End With Load_Cancel: End Sub |