Click here to Skip to main content
15,895,011 members
Articles / Desktop Programming / Windows Forms

Another Article on MP3 Players using Windows Media Player

Rate me:
Please Sign up or sign in to vote.
4.21/5 (5 votes)
12 Nov 2008CPOL2 min read 45.7K   1.8K   18  
Play your MP3s with this Audio Player
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmPlayer
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmPlayer))
        Me.axWMP = New AxWMPLib.AxWindowsMediaPlayer
        Me.playBar = New System.Windows.Forms.TrackBar
        Me.btnPlay = New System.Windows.Forms.Button
        Me.btnPause = New System.Windows.Forms.Button
        Me.btnStop = New System.Windows.Forms.Button
        Me.btnOpen = New System.Windows.Forms.Button
        Me.tbVolume = New System.Windows.Forms.TrackBar
        Me.tbBalance = New System.Windows.Forms.TrackBar
        Me.lblVolume = New System.Windows.Forms.Label
        Me.lblBalance = New System.Windows.Forms.Label
        Me.lstFiles = New System.Windows.Forms.ListBox
        Me.btnClose = New System.Windows.Forms.Button
        Me.btnRemove = New System.Windows.Forms.Button
        Me.btnSkip = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        Me.ofd = New System.Windows.Forms.OpenFileDialog
        Me.timerDuration = New System.Windows.Forms.Timer(Me.components)
        Me.lblTime = New System.Windows.Forms.Label
        Me.txtMemo = New System.Windows.Forms.TextBox
        Me.lblDuration = New System.Windows.Forms.Label
        Me.chkRepeat = New System.Windows.Forms.CheckBox
        CType(Me.axWMP, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.playBar, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.tbVolume, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.tbBalance, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'axWMP
        '
        Me.axWMP.Enabled = True
        Me.axWMP.Location = New System.Drawing.Point(25, 23)
        Me.axWMP.Name = "axWMP"
        Me.axWMP.OcxState = CType(resources.GetObject("axWMP.OcxState"), System.Windows.Forms.AxHost.State)
        Me.axWMP.Size = New System.Drawing.Size(201, 185)
        Me.axWMP.TabIndex = 0
        '
        'playBar
        '
        Me.playBar.AutoSize = False
        Me.playBar.BackColor = System.Drawing.Color.OliveDrab
        Me.playBar.Cursor = System.Windows.Forms.Cursors.No
        Me.playBar.Location = New System.Drawing.Point(12, 214)
        Me.playBar.Maximum = 100
        Me.playBar.Name = "playBar"
        Me.playBar.Size = New System.Drawing.Size(223, 32)
        Me.playBar.TabIndex = 1
        '
        'btnPlay
        '
        Me.btnPlay.BackColor = System.Drawing.Color.LimeGreen
        Me.btnPlay.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnPlay.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnPlay.Location = New System.Drawing.Point(238, 279)
        Me.btnPlay.Name = "btnPlay"
        Me.btnPlay.Size = New System.Drawing.Size(46, 22)
        Me.btnPlay.TabIndex = 2
        Me.btnPlay.Text = "Play"
        Me.btnPlay.UseVisualStyleBackColor = False
        '
        'btnPause
        '
        Me.btnPause.BackColor = System.Drawing.Color.LimeGreen
        Me.btnPause.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnPause.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnPause.Location = New System.Drawing.Point(238, 307)
        Me.btnPause.Name = "btnPause"
        Me.btnPause.Size = New System.Drawing.Size(46, 22)
        Me.btnPause.TabIndex = 3
        Me.btnPause.Text = "Pause"
        Me.btnPause.UseVisualStyleBackColor = False
        '
        'btnStop
        '
        Me.btnStop.BackColor = System.Drawing.Color.LimeGreen
        Me.btnStop.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnStop.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnStop.Location = New System.Drawing.Point(238, 334)
        Me.btnStop.Name = "btnStop"
        Me.btnStop.Size = New System.Drawing.Size(46, 22)
        Me.btnStop.TabIndex = 4
        Me.btnStop.Text = "Stop"
        Me.btnStop.UseVisualStyleBackColor = False
        '
        'btnOpen
        '
        Me.btnOpen.BackColor = System.Drawing.Color.LimeGreen
        Me.btnOpen.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnOpen.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnOpen.Location = New System.Drawing.Point(238, 251)
        Me.btnOpen.Name = "btnOpen"
        Me.btnOpen.Size = New System.Drawing.Size(46, 22)
        Me.btnOpen.TabIndex = 5
        Me.btnOpen.Text = "Open"
        Me.btnOpen.UseVisualStyleBackColor = False
        '
        'tbVolume
        '
        Me.tbVolume.AutoSize = False
        Me.tbVolume.BackColor = System.Drawing.Color.OliveDrab
        Me.tbVolume.Cursor = System.Windows.Forms.Cursors.Hand
        Me.tbVolume.Location = New System.Drawing.Point(25, 261)
        Me.tbVolume.Maximum = 100
        Me.tbVolume.Name = "tbVolume"
        Me.tbVolume.Size = New System.Drawing.Size(202, 31)
        Me.tbVolume.TabIndex = 6
        Me.tbVolume.TabStop = False
        Me.tbVolume.Value = 50
        '
        'tbBalance
        '
        Me.tbBalance.AutoSize = False
        Me.tbBalance.BackColor = System.Drawing.Color.OliveDrab
        Me.tbBalance.Cursor = System.Windows.Forms.Cursors.Hand
        Me.tbBalance.Location = New System.Drawing.Point(25, 311)
        Me.tbBalance.Maximum = 100
        Me.tbBalance.Minimum = -100
        Me.tbBalance.Name = "tbBalance"
        Me.tbBalance.Size = New System.Drawing.Size(202, 29)
        Me.tbBalance.TabIndex = 7
        Me.tbBalance.TabStop = False
        '
        'lblVolume
        '
        Me.lblVolume.AutoSize = True
        Me.lblVolume.ForeColor = System.Drawing.Color.Black
        Me.lblVolume.Location = New System.Drawing.Point(82, 295)
        Me.lblVolume.Name = "lblVolume"
        Me.lblVolume.Size = New System.Drawing.Size(67, 13)
        Me.lblVolume.TabIndex = 8
        Me.lblVolume.Text = "Volume is at "
        '
        'lblBalance
        '
        Me.lblBalance.AutoSize = True
        Me.lblBalance.ForeColor = System.Drawing.Color.Black
        Me.lblBalance.Location = New System.Drawing.Point(61, 344)
        Me.lblBalance.Name = "lblBalance"
        Me.lblBalance.Size = New System.Drawing.Size(59, 13)
        Me.lblBalance.TabIndex = 9
        Me.lblBalance.Text = "Balance is "
        '
        'lstFiles
        '
        Me.lstFiles.BackColor = System.Drawing.Color.DarkSeaGreen
        Me.lstFiles.Cursor = System.Windows.Forms.Cursors.Hand
        Me.lstFiles.FormattingEnabled = True
        Me.lstFiles.Location = New System.Drawing.Point(238, 22)
        Me.lstFiles.Name = "lstFiles"
        Me.lstFiles.ScrollAlwaysVisible = True
        Me.lstFiles.Size = New System.Drawing.Size(252, 212)
        Me.lstFiles.TabIndex = 10
        '
        'btnClose
        '
        Me.btnClose.BackColor = System.Drawing.Color.LimeGreen
        Me.btnClose.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnClose.Location = New System.Drawing.Point(410, 334)
        Me.btnClose.Name = "btnClose"
        Me.btnClose.Size = New System.Drawing.Size(81, 22)
        Me.btnClose.TabIndex = 11
        Me.btnClose.Text = "Close"
        Me.btnClose.UseVisualStyleBackColor = False
        '
        'btnRemove
        '
        Me.btnRemove.BackColor = System.Drawing.Color.LimeGreen
        Me.btnRemove.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnRemove.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnRemove.Location = New System.Drawing.Point(410, 307)
        Me.btnRemove.Name = "btnRemove"
        Me.btnRemove.Size = New System.Drawing.Size(81, 22)
        Me.btnRemove.TabIndex = 12
        Me.btnRemove.Text = "Remove"
        Me.btnRemove.UseVisualStyleBackColor = False
        '
        'btnSkip
        '
        Me.btnSkip.BackColor = System.Drawing.Color.LimeGreen
        Me.btnSkip.Cursor = System.Windows.Forms.Cursors.Hand
        Me.btnSkip.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.btnSkip.Location = New System.Drawing.Point(410, 279)
        Me.btnSkip.Name = "btnSkip"
        Me.btnSkip.Size = New System.Drawing.Size(81, 22)
        Me.btnSkip.TabIndex = 14
        Me.btnSkip.Text = "Skip Song"
        Me.btnSkip.UseVisualStyleBackColor = False
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Enabled = False
        Me.Label1.ForeColor = System.Drawing.Color.White
        Me.Label1.Location = New System.Drawing.Point(126, 6)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(242, 13)
        Me.Label1.TabIndex = 15
        Me.Label1.Text = "Created by : R. S. Percy           a.k.a. Oilcan Harry"
        '
        'ofd
        '
        Me.ofd.Multiselect = True
        Me.ofd.RestoreDirectory = True
        '
        'timerDuration
        '
        '
        'lblTime
        '
        Me.lblTime.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblTime.ForeColor = System.Drawing.Color.Black
        Me.lblTime.Location = New System.Drawing.Point(300, 237)
        Me.lblTime.Name = "lblTime"
        Me.lblTime.Size = New System.Drawing.Size(39, 25)
        Me.lblTime.TabIndex = 16
        Me.lblTime.Text = "00:00"
        Me.lblTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'txtMemo
        '
        Me.txtMemo.BackColor = System.Drawing.Color.DarkSeaGreen
        Me.txtMemo.Cursor = System.Windows.Forms.Cursors.No
        Me.txtMemo.ForeColor = System.Drawing.Color.Black
        Me.txtMemo.Location = New System.Drawing.Point(290, 265)
        Me.txtMemo.Multiline = True
        Me.txtMemo.Name = "txtMemo"
        Me.txtMemo.Size = New System.Drawing.Size(113, 103)
        Me.txtMemo.TabIndex = 17
        Me.txtMemo.Visible = False
        '
        'lblDuration
        '
        Me.lblDuration.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblDuration.ForeColor = System.Drawing.Color.Black
        Me.lblDuration.Location = New System.Drawing.Point(354, 241)
        Me.lblDuration.Name = "lblDuration"
        Me.lblDuration.Size = New System.Drawing.Size(39, 16)
        Me.lblDuration.TabIndex = 18
        Me.lblDuration.Text = "00:00"
        Me.lblDuration.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'chkRepeat
        '
        Me.chkRepeat.AutoSize = True
        Me.chkRepeat.Location = New System.Drawing.Point(410, 255)
        Me.chkRepeat.Name = "chkRepeat"
        Me.chkRepeat.Size = New System.Drawing.Size(61, 17)
        Me.chkRepeat.TabIndex = 19
        Me.chkRepeat.Text = "Repeat"
        Me.chkRepeat.UseVisualStyleBackColor = True
        '
        'frmPlayer
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.BackColor = System.Drawing.Color.DarkOliveGreen
        Me.ClientSize = New System.Drawing.Size(503, 380)
        Me.Controls.Add(Me.chkRepeat)
        Me.Controls.Add(Me.lblDuration)
        Me.Controls.Add(Me.txtMemo)
        Me.Controls.Add(Me.lblTime)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.btnSkip)
        Me.Controls.Add(Me.btnRemove)
        Me.Controls.Add(Me.btnClose)
        Me.Controls.Add(Me.lstFiles)
        Me.Controls.Add(Me.lblBalance)
        Me.Controls.Add(Me.lblVolume)
        Me.Controls.Add(Me.tbBalance)
        Me.Controls.Add(Me.tbVolume)
        Me.Controls.Add(Me.btnOpen)
        Me.Controls.Add(Me.btnStop)
        Me.Controls.Add(Me.btnPause)
        Me.Controls.Add(Me.btnPlay)
        Me.Controls.Add(Me.playBar)
        Me.Controls.Add(Me.axWMP)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.Name = "frmPlayer"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Audio Player WMP®---mp3's only"
        CType(Me.axWMP, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.playBar, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.tbVolume, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.tbBalance, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents axWMP As AxWMPLib.AxWindowsMediaPlayer
    Friend WithEvents playBar As System.Windows.Forms.TrackBar
    Friend WithEvents btnPlay As System.Windows.Forms.Button
    Friend WithEvents btnPause As System.Windows.Forms.Button
    Friend WithEvents btnStop As System.Windows.Forms.Button
    Friend WithEvents btnOpen As System.Windows.Forms.Button
    Friend WithEvents tbVolume As System.Windows.Forms.TrackBar
    Friend WithEvents tbBalance As System.Windows.Forms.TrackBar
    Friend WithEvents lblVolume As System.Windows.Forms.Label
    Friend WithEvents lblBalance As System.Windows.Forms.Label
    Friend WithEvents lstFiles As System.Windows.Forms.ListBox
    Friend WithEvents btnClose As System.Windows.Forms.Button
    Friend WithEvents btnRemove As System.Windows.Forms.Button
    Friend WithEvents btnSkip As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents ofd As System.Windows.Forms.OpenFileDialog
    Friend WithEvents timerDuration As System.Windows.Forms.Timer
    Friend WithEvents lblTime As System.Windows.Forms.Label
    Friend WithEvents txtMemo As System.Windows.Forms.TextBox
    Friend WithEvents lblDuration As System.Windows.Forms.Label
    Friend WithEvents chkRepeat As System.Windows.Forms.CheckBox

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Retired
United States United States
I am currently retired.
I have no degree but I have some programming experience
when I was in college(Cobol, Pascal).

My accomplishments thus far are;
Best VB.Net article for January(2009)
Best VB.Net article for July(2009)

Comments and Discussions