Share via


Windows Media Player 11 SDK IWMPControls.previous (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPControls.previous (VB and C#)

The previous method sets the previous item in the playlist as the current item.

  

Parameters

This method takes no parameters.

Return Value

This method does not return a value.

Remarks

If the playlist is on the first entry when previous is invoked, the last entry in the playlist will become the current one.

Example Code

The following example uses previous to move to the previous item in the current playlist in response to the Click event of a button. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
Public Sub previousButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles previousButton.Click

    ' To get all of the available functionality of the player controls, Dim the
    ' value returned by player.Ctlcontrols as a WMPLib.IWMPControls3 interface.
    Dim controls As WMPLib.IWMPControls3 = player.Ctlcontrols

    ' Check first to be sure the operation is valid. 
    If (controls.isAvailable("previous")) Then

        controls.previous()

    End If

End Sub

FakePre-810140366b5d4654a62f295456fe3be6-8fe48a7162ea4beea3d4e259b24320b1

private void previousButton_Click(object o, System.EventArgs args)
{
    // To get all of the available functionality of the player controls, cast the
    // value returned by player.Ctlcontrols to a WMPLib.IWMPControls3 interface. 
    WMPLib.IWMPControls3 controls = (WMPLib.IWMPControls3)player.Ctlcontrols;

    // Check first to be sure the operation is valid. 
    if (controls.get_isAvailable("previous"))
    {
        controls.previous();
    }
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next