Home » » cara membuat musik player sederhana dari visual basic

cara membuat musik player sederhana dari visual basic

cara membuat musik player sederhana dari visual basic
siapkan
1 buah openfiledialog1
1 buah timer
5 buah botton
ni contoh gambar nya


















dan ni kode program nya


Public Class Form1

    Private Sub btn_bukafile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_bukafile.Click
        If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            WMP.URL = OpenFileDialog1.FileName
        End If

    End Sub

    Private Sub btn_mulai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_mulai.Click
        WMP.Ctlcontrols.play()
    End Sub

    Private Sub btn_stop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_stop.Click
        WMP.Ctlcontrols.stop()

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Try
            If WMP.playState = WMPLib.WMPPlayState.wmppsPlaying Then
                Label1.Text = "Now Playing: " + WMP.currentMedia.name + Environment.NewLine + "Time: " + WMP.Ctlcontrols.currentPositionString + " / " + WMP.currentMedia.name
            Else
                Label1.Text = "Not Playing"
            End If
        Catch ex As Exception
            MsgBox("Eroor we" + Environment.NewLine + ex.Message.ToString, MsgBoxStyle.Critical + MsgBoxStyle.MsgBoxSetForeground)
            Application.Exit() 'jika eroror'
        End Try

    End Sub

    Private Sub btn_pause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_pause.Click
        WMP.Ctlcontrols.pause()
    End Sub

    
    
    Private Sub btn_play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_play.Click
        WMP.Ctlcontrols.play()
    End Sub
End Class


selamat mencoba terimah kasih




1 comments:

  1. Harrah's Cherokee Casino & Hotel - Mapyro
    Harrah's Cherokee Casino & Hotel - 안산 출장마사지 Find 전라남도 출장마사지 your way around the 시흥 출장안마 casino, find where 아산 출장샵 everything is located with this helpful guide. Rating: 3.5 · ‎7 reviews 하남 출장안마

    BalasHapus