- Version
- Download 77
- File Size 319.87 KB
- File Count 1
- Create Date March 10, 2016
- Last Updated March 10, 2016
Media Player in Visual Basic.Net
Media Player in Visual Basic.Net
This program will allow you to select a video file from your computer and play it in the media player component of visual basic.net.
To use the windows media player control, you need to add first in the toolbox.
Right- Toolbox, and then select Choose Items. A dialog box will appear, select the COM Components tab, select Windows Media Player and click ok.
Source code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
Label1.Text = OpenFileDialog1.SafeFileName
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
AxWindowsMediaPlayer1.fullScreen = True
End Sub
End Class