Membuat Media Player Sederhana di VB
Membuat Media Player Sederhana di VB - Pada kali ini saya membuat tutorial bagaimana cara membuat media player dengan visual basic. langsung saja
1. Layout
Layout dengan 3 button ,windows media dan menu strip .Tambahan openfiledialog agar dapat membuka file.
2. Script
Public Class Form1
Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AxWindowsMediaPlayer1.uiMode = "none"
End Sub
Private Sub OpenMediaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenMediaToolStripMenuItem.Click
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.uiMode = "none"
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxWindowsMediaPlayer1.Ctlcontrols.play()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
AxWindowsMediaPlayer1.Ctlcontrols.pause()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
AxWindowsMediaPlayer1.Ctlcontrols.stop()
End Sub
Button akan berfungsi dengan masing2 nama
3. Hasil
Sekian semoga bermanfaat-------------------------------------------------------
1. Layout
Layout dengan 3 button ,windows media dan menu strip .Tambahan openfiledialog agar dapat membuka file.
2. Script
Public Class Form1
Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AxWindowsMediaPlayer1.uiMode = "none"
End Sub
Private Sub OpenMediaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenMediaToolStripMenuItem.Click
OpenFileDialog1.ShowDialog()
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
AxWindowsMediaPlayer1.uiMode = "none"
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxWindowsMediaPlayer1.Ctlcontrols.play()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
AxWindowsMediaPlayer1.Ctlcontrols.pause()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
AxWindowsMediaPlayer1.Ctlcontrols.stop()
End Sub
Button akan berfungsi dengan masing2 nama
3. Hasil
Sekian semoga bermanfaat-------------------------------------------------------
No comments: