Share via


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

Windows Media Player SDK banner art

Previous Next

IWMPControls.currentPosition (VB and C#)

The currentPosition property gets or sets the current position in the media item in seconds from the beginning.

  

Property Value

A System.Double that is the current position.

Example Code

The following example uses currentPosition to seek to a position provided by the user. In response to a button click, currentPosition is set to the value entered in a text box called newPosition. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
Public Sub setPosition_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles setPosition.Click

    ' ...Add code to ensure that the text box contains a valid value.

    ' Set the current position of the media item to the position entered by the user.
    player.Ctlcontrols.currentPosition = Convert.ToDouble(newPosition.Text)

End Sub

FakePre-6262d8da88314d4f9082320eebf3f0da-a5524ab7a89747759bd511ee37462e42

private void setPosition_Click(object sender, System.EventArgs e)
{ 
    // ...Add code to ensure that the text box contains a valid value.
 
    // Set the current position of the media item to the position entered by the user.
    player.Ctlcontrols.currentPosition = Convert.ToDouble(newPosition.Text);
}

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

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

See Also

Previous Next