Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / Win32

Rating Stars for Windows Media Player

Rate me:
Please Sign up or sign in to vote.
3.67/5 (2 votes)
16 Mar 2009CPOL2 min read 22.4K   468   8  
How to create stars to display the UserRating property in WMP.
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    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()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
        Me.TrackBar1 = New System.Windows.Forms.TrackBar
        Me.Button1 = New System.Windows.Forms.Button
        Me.AxWindowsMediaPlayer1 = New AxWMPLib.AxWindowsMediaPlayer
        Me.WmpRatingStars1 = New WMPRatingStars.WMPRatingStars
        Me.WmpRatingStars2 = New WMPRatingStars.WMPRatingStars
        CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.AxWindowsMediaPlayer1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'OpenFileDialog1
        '
        Me.OpenFileDialog1.Filter = "*.mp3|*.mp3"
        '
        'TrackBar1
        '
        Me.TrackBar1.Location = New System.Drawing.Point(70, 151)
        Me.TrackBar1.Maximum = 99
        Me.TrackBar1.Name = "TrackBar1"
        Me.TrackBar1.Size = New System.Drawing.Size(145, 45)
        Me.TrackBar1.TabIndex = 2
        Me.TrackBar1.TickFrequency = 9
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(9, 62)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(104, 29)
        Me.Button1.TabIndex = 3
        Me.Button1.Text = "Open File"
        Me.Button1.UseVisualStyleBackColor = True
        '
        'AxWindowsMediaPlayer1
        '
        Me.AxWindowsMediaPlayer1.Enabled = True
        Me.AxWindowsMediaPlayer1.Location = New System.Drawing.Point(12, 12)
        Me.AxWindowsMediaPlayer1.Name = "AxWindowsMediaPlayer1"
        Me.AxWindowsMediaPlayer1.OcxState = CType(resources.GetObject("AxWindowsMediaPlayer1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxWindowsMediaPlayer1.Size = New System.Drawing.Size(249, 44)
        Me.AxWindowsMediaPlayer1.TabIndex = 4
        '
        'WmpRatingStars1
        '
        Me.WmpRatingStars1.Location = New System.Drawing.Point(70, 190)
        Me.WmpRatingStars1.Margin = New System.Windows.Forms.Padding(0)
        Me.WmpRatingStars1.Name = "WmpRatingStars1"
        Me.WmpRatingStars1.RateEnabled = True
        Me.WmpRatingStars1.Rating = CType(99, Byte)
        Me.WmpRatingStars1.Size = New System.Drawing.Size(145, 29)
        Me.WmpRatingStars1.Star = CType(resources.GetObject("WmpRatingStars1.Star"), System.Drawing.Image)
        Me.WmpRatingStars1.StarBackground = CType(resources.GetObject("WmpRatingStars1.StarBackground"), System.Drawing.Image)
        Me.WmpRatingStars1.StarMouseOver = CType(resources.GetObject("WmpRatingStars1.StarMouseOver"), System.Drawing.Image)
        Me.WmpRatingStars1.TabIndex = 5
        '
        'WmpRatingStars2
        '
        Me.WmpRatingStars2.Location = New System.Drawing.Point(116, 62)
        Me.WmpRatingStars2.Margin = New System.Windows.Forms.Padding(0)
        Me.WmpRatingStars2.Name = "WmpRatingStars2"
        Me.WmpRatingStars2.RateEnabled = True
        Me.WmpRatingStars2.Rating = CType(99, Byte)
        Me.WmpRatingStars2.Size = New System.Drawing.Size(145, 29)
        Me.WmpRatingStars2.Star = CType(resources.GetObject("WmpRatingStars2.Star"), System.Drawing.Image)
        Me.WmpRatingStars2.StarBackground = CType(resources.GetObject("WmpRatingStars2.StarBackground"), System.Drawing.Image)
        Me.WmpRatingStars2.StarMouseOver = CType(resources.GetObject("WmpRatingStars2.StarMouseOver"), System.Drawing.Image)
        Me.WmpRatingStars2.TabIndex = 6
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.Add(Me.WmpRatingStars2)
        Me.Controls.Add(Me.WmpRatingStars1)
        Me.Controls.Add(Me.AxWindowsMediaPlayer1)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.TrackBar1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.AxWindowsMediaPlayer1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
    Friend WithEvents TrackBar1 As System.Windows.Forms.TrackBar
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents AxWindowsMediaPlayer1 As AxWMPLib.AxWindowsMediaPlayer
    Friend WithEvents WmpRatingStars1 As WMPRatingStars.WMPRatingStars
    Friend WithEvents WmpRatingStars2 As WMPRatingStars.WMPRatingStars

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
Software Developer
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions