Visual Basic: Windows Controls

Open Method (Animation Control) Example

The following example opens an .avi file by using the Open Dialog, and begins playing it automatically. To try the example, place an Animation control and a CommonDialog control on a form, and paste the code into the form's Declarations section. Run the example, and choose an .avi file to open.

Private Sub Animation1_Click ()
   With CommonDialog1
      .Filter = "avi (*.avi)|*.avi"
   End With
   With Animation1
      .Autoplay = True
      .Open CommonDialog1.Filename
   End With
End Sub