PictureBox скрывает всю рутинную работу по организации проигрывания анимации Gif файла. Вручную, для иллюстрации самого процесса, достаточно воспользоваться классом Image и таймером.
Пример на VB.NET
Код:
![Выделить весь код](images/misc/selectcode.png)
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Drawing.Imaging
Class GifPlayer
Inherits Form
Dim imFile As Image
Dim iFrame As Single = 0
Dim frameCount As Single
Dim Dimension As FrameDimension
Dim tmr As New Timer()
Shared Sub Main()
Application.Run(New GifPlayer())
End Sub
Sub New()
imFile = Image.FromFile("My.gif")
Dimension = New FrameDimension(imFile.FrameDimensionsList(0))
frameCount = imFile.GetFrameCount(Dimension)
AddHandler tmr.Tick, AddressOf TimerOnTick
tmr.Interval = 100
tmr.Enabled = True
End Sub
Private Sub TimerOnTick(ByVal obj As Object, ByVal ea As EventArgs)
imFile.SelectActiveFrame(Dimension, iFrame)
iFrame += 1
Dim grfx As Graphics = CreateGraphics()
grfx.DrawImage(imFile, Point.Empty)
grfx.Dispose()
If iFrame >= frameCount Then tmr.Enabled = False
End Sub
End Class
Единственное, время анимации берётся не из Gif файла, а задаётся явно (100мс на каждый кадр в примере выше).
Собственно
If iFrame >= frameCount и будет условием окончания проигрывания анимации.