Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleDisplay an animated GIF file
KeywordsGIF, animated, animation
CategoriesGraphics
 
Thanks to Barry Traver.

Load the GIF into a WebBrowser control. Place a PictureBox over the scroll bar to hide it.

 
Private Sub Form_Load()
Const SBAR_WIDTH = 17
Const BORDER_WIDTH = 2

Dim fname As String
Dim w As Single
Dim h As Single
Dim l As Single
Dim t As Single

    ' Get the filename.
    fname = App.Path
    If Right$(fname, 1) <> "\" Then fname = fname & "\"
    fname = fname & "clip.gif"

    ' Display the GIF.
    WebBrowser1.Navigate fname

    ' Cover the scroll bar.
    Picture1.BorderStyle = vbBSNone
    Picture1.BackColor = vbWhite
    w = ScaleX(SBAR_WIDTH, vbPixels, ScaleMode)
    h = WebBrowser1.Height - ScaleX(2 * BORDER_WIDTH, _
        vbPixels, ScaleMode)
    l = WebBrowser1.Left + WebBrowser1.Width - _
        ScaleX(SBAR_WIDTH + BORDER_WIDTH, vbPixels, _
            ScaleMode)
    t = WebBrowser1.Top + ScaleY(BORDER_WIDTH, vbPixels, _
        ScaleMode)
    Picture1.Move l, t, w, h
    Picture1.ZOrder
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated