IWMPControls::currentPosition property

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

Syntax



public System.Double currentPosition {get; set;}

Property value

A System.Double that is the current position.

Examples

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.



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 (Interop.WMPLib.dll.dll)

See also

IWMPControls Interface (VB and C#)
IWMPControls.currentPositionString (VB and C#)

 

 

Show: