Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 5.17 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  4.         OpenFileDialog1.ShowDialog()
  5.         WindowsMediaPlayer1.URL = OpenFileDialog1.FileName
  6.         Label1.Text = WindowsMediaPlayer1.currentMedia.name
  7.         Label1.Left = 100
  8.         ListBox1.Items.Add(WindowsMediaPlayer1.URL)
  9.     End Sub
  10.  
  11.     Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  12.         ListBox1.Items.Add(WindowsMediaPlayer1.URL)
  13.     End Sub
  14.  
  15.     Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  16.         ListBox1.Items.Remove(ListBox1.SelectedItem)
  17.     End Sub
  18.  
  19.     Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
  20.         Try
  21.             WindowsMediaPlayer1.URL = ListBox1.SelectedItem
  22.             Label1.Text = WindowsMediaPlayer1.currentMedia.name
  23.             Label1.Left = 100
  24.         Catch ex As Exception
  25.  
  26.         End Try
  27.     End Sub
  28.  
  29.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  30.         WindowsMediaPlayer1.Ctlcontrols.previous()
  31.     End Sub
  32.  
  33.     Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
  34.         WindowsMediaPlayer1.settings.volume = TrackBar1.Value
  35.     End Sub
  36.  
  37.     Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  38.         WindowsMediaPlayer1.Ctlcontrols.play()
  39.     End Sub
  40.  
  41.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  42.         WindowsMediaPlayer1.Ctlcontrols.pause()
  43.     End Sub
  44.  
  45.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  46.         WindowsMediaPlayer1.Ctlcontrols.stop()
  47.     End Sub
  48.  
  49.     Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
  50.         WindowsMediaPlayer1.Ctlcontrols.previous()
  51.     End Sub
  52.  
  53.     Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  54.         WindowsMediaPlayer1.Ctlcontrols.next()
  55.     End Sub
  56.  
  57.     Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
  58.         ListBox1.Items.Clear()
  59.     End Sub
  60.  
  61.     Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
  62.         WindowsMediaPlayer1.settings.mute = CheckBox1.Checked
  63.     End Sub
  64.  
  65.     Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
  66.         Dim SaveFile As New SaveFileDialog()
  67.         SaveFile.Filter = "bwmp Files |*.bwmp"
  68.         SaveFile.ShowDialog()
  69.         Dim WriteFile As New System.IO.StreamWriter(SaveFile.FileName)
  70.         Dim Count As Integer = ListBox1.Items.Count - Val(1)
  71.         For i As Integer = 0 To Count
  72.             WriteFile.Write(ListBox1.Items.Item(i) & ";")
  73.         Next
  74.         WriteFile.Close()
  75.     End Sub
  76.  
  77.     Private Sub LoadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadToolStripMenuItem.Click
  78.         Dim OpenFile As New OpenFileDialog
  79.         OpenFile.Filter = "bwmp Files |*.bwmp"
  80.         OpenFile.FileName = ""
  81.         OpenFile.ShowDialog()
  82.         Dim ReadFile As New System.IO.StreamReader(OpenFile.FileName)
  83.         Dim Playlist As String = ReadFile.ReadToEnd
  84.         Dim SplittedFase() = Playlist.Split(";")
  85.         Dim Count As Integer = SplittedFase.Count - Val(1)
  86.         Dim i As Integer = 0
  87.         Do Until i = Count
  88.             ListBox1.Items.Add(SplittedFase(i))
  89.             i += Val(1)
  90.         Loop
  91.         ReadFile.Close()
  92.     End Sub
  93.  
  94.     Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  95.         WindowsMediaPlayer1.Ctlcontrols.fastForward()
  96.     End Sub
  97.  
  98.     Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
  99.         WindowsMediaPlayer1.Ctlcontrols.fastReverse()
  100.     End Sub
  101.  
  102.     Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
  103.         AboutBox1.Show()
  104.     End Sub
  105.  
  106.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  107.         If Label1.Left = -300 Then
  108.             Label1.Left = 429
  109.         Else
  110.             Label1.Left -= 2
  111.         End If
  112.     End Sub
  113.  
  114.     Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
  115.         If (WindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped) Then
  116.             If (ListBox1.SelectedIndex < ListBox1.Items.Count - 1) Then
  117.                 ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
  118.                 WindowsMediaPlayer1.URL = ListBox1.SelectedItem
  119.                 WindowsMediaPlayer1.Ctlcontrols.play()
  120.             End If
  121.         End If
  122.     End Sub
  123. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement