- Home
·
- Sound/MP3
·
- Easly play .avi files in your program, like the windows File Copy, Delete and many more! Use th
Easly play .avi files in your program, like the windows File Copy, Delete and many more! Use th
Easly play .avi files in your program, like the windows "File Copy", "Delete" and many more! Use this code to create a simple AVI player of
API Declarations
'On your form, place a CommonDialog, a CommandButton and a Animation (called: commondialog1, command1 and animation1)
'Animation, and Common Dialog can be found in the tool bar, if you have Professional+ Form controls, if not look through the Components menu, (right click tool bar) and look for them there.
Rate Easly play .avi files in your program, like the windows File Copy, Delete and many more! Use th
(2(2 Vote))
On Error GoTo cancel
CommonDialog1.ShowOpen ' brings up the Open screen
On Error GoTo error
Animation1.open CommonDialog1.FileName ' opens the selected file, and biggins to play it - note, if you wish to only run an avi during an event, like file copy, only this line is needed, just replace "CommonDialog1.FileName" with your avi, like "c:\myavi.avi"
Exit Sub
error: MsgBox Err.Description, vbCritical, "Error Number " & Err.Number
cancel: ' if the user clicks cancel, the program does not open, it just leaves the sub
End Sub
Private Sub Form_Load()
Command1.Caption = "Load AVI" ' makes your button label correct
Animation1.AutoPlay = True ' ensures the selected avi plays when it is opened
CommonDialog1.CancelError = True ' makes the program follow the error goto if the user clicks cancel
End Sub
Easly play .avi files in your program, like the windows File Copy, Delete and many more! Use th Comments
No comments yet — be the first to post one!
Post a Comment