If you are working with Windows (so, you are not working with web), then, you can use a pricipal control: a PictureBox; and some secondary controls: three buttons (for starting, pausing and stopping audio/video), a tooltip (if you want to add a small description under the buttons) and a OpenFileDialog.
Set the properties of the openfiledialog (name: ofdFile), check if the users has selected an Image or an audio file or a video file with this code: (read the comment becuase it is important!
Public enum TypeFile As Byte
Audio
Video
Image
End Enum
Public Function FileType(FileName As String) As TypeFile
Select case mid(FileName,Filename.lenght-3,3)
Case "jpg"
return TypeFile.Image
End select
End sub
Then you have to add the PictureBox control with VB code:
You have to add in project window the references to
Microsoft.DirectX
Microsoft.DirectX.AudioVideoPlayback
Imports Microsoft.DirectX
Imports Microsoft.DirectX.AudioVideoPlayback
Public class Form1
Dim audio1 As Audio
Dim video As Video
Dim imm As System.Drawing.Image
Public sub AfterSelectFile(FileName As String)
Dim TP As TypeFile
TP = FileType(FileName)
Select Case TP
Case 0
Me.Button1.Visible = true
Me.button2.Visible = true
Me.Button3.Visible = true
try
audio1 = new Audio(FileName)
Catch ex As Exception
MsgBox("ERROR!")
End Try
Case 1
me.PictureBox1.Visible = true
Me.Button1V.Visible = true
Me.button2V.Visible = true
Me.Button3V.Visible = true
try
Video = new video(FileName)
video.owner = me.picturebox1
Catch ex As Exception
MsgBox("ERROR!")
End Try
Case 2
Me.PictureBox1.Visible = true
image = new image(Filename)
me.picturebox1.image = image
End Select
I hope that on your computer works all correcty, because on mine, the first time I tried to make a similar program, I had a lot of problems.