Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Class Form1
Dim img As Image = Image.FromFile("c:\ani.gif")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ic As New DataGridViewImageColumn
ic.Width = img.Width
dg.Columns.Add(ic)
AddHandler dg.CellPainting, AddressOf dg_CellPainting
ImageAnimator.Animate(img, New EventHandler(AddressOf OnFrameChanged))
End Sub
Private Sub OnFrameChanged(ByVal sender As Object, ByVal e As EventArgs)
dg.Invalidate()
End Sub
Private Sub dg_CellPainting(ByVal sender As Object, ByVal e As DataGridViewCellPaintingEventArgs)
If e.RowIndex >= 0 AndAlso e.ColumnIndex = 0 Then
e.Paint(e.CellBounds, DataGridViewPaintParts.Background)
ImageAnimator.UpdateFrames()
e.Graphics.DrawImage(img, e.CellBounds.Location)
e.Handled = True
End If
End Sub
End Class