How can I run an animated gif in VB?
Printable View
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:
------------------Code: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
Aaron Young
Analyst Programmer
[email protected]
[email protected]
At www.codeguru.com/vb , ActiveX section, is a free ocx available for download to display animated gifs.