Tutorial visual basic 2008 media playerPublic Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OpenFileDialog1.ShowDialog() ToolStripStatusLabel1.Text = OpenFileDialog1.FileName End Sub Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk My.Computer.Audio.Play(OpenFileDialog1.FileName, AudioPlayMode.Background) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click My.Computer.Audio.Stop() ToolStripStatusLabel1.Text = "aucun audio en cours" End Sub Private Sub LoadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadToolStripMenuItem.Click OpenFileDialog1.ShowDialog() ToolStripStatusLabel1.Text = OpenFileDialog1.FileName End Sub Private Sub QuitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles QuitToolStripMenuItem.Click End End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ToolStripTextBox1.Text = My.Computer.Clock.LocalTime End Sub End Class code pour embarquer la vidéo : >>> http://www.youtube.com/embed/BI0rUZ_jYJ8 <<< |