IWMPControls :: currentPosition, propriété
La propriété CurrentPosition obtient ou définit la position actuelle dans l’élément multimédia, en secondes, à partir du début.
Syntaxe
public System.Double currentPosition {get; set;}
Public Property currentPosition As System.Double
Valeur de la propriété
System. double qui correspond à la position actuelle.
Exemples
L’exemple suivant utilise CurrentPosition pour rechercher une position fournie par l’utilisateur. En réponse à un clic sur un bouton, CurrentPosition est défini sur la valeur entrée dans une zone de texte appelée NewPosition. L’objet AxWMPLib. AxWindowsMediaPlayer est représenté par la variable 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);
}
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
Spécifications
| Condition requise | Valeur |
|---|---|
| Version |
Lecteur Windows Media série 9 ou version ultérieure |
| Espace de noms |
WMPLib |
| Assembly |
|