Audio.PlaySystemSound(SystemSound) Méthode

Définition

Lit un son système.

public:
 void PlaySystemSound(System::Media::SystemSound ^ systemSound);
public void PlaySystemSound (System.Media.SystemSound systemSound);
member this.PlaySystemSound : System.Media.SystemSound -> unit
Public Sub PlaySystemSound (systemSound As SystemSound)

Paramètres

systemSound
SystemSound

Objet SystemSound représentant le son système à lire.

Exceptions

systemSound a la valeur Nothing.

Exemples

Cet exemple utilise la My.Computer.Audio.PlaySystemSound méthode pour lire un son système.

Sub PlaySystemSound()
    My.Computer.Audio.PlaySystemSound( 
        System.Media.SystemSounds.Asterisk)
End Sub

Cet exemple de code ne peut s’exécuter qu’au sein d’une application Windows Forms.

Remarques

La PlaySystemSound méthode lit le son système décrit par systemSound; le son est lu une fois, en arrière-plan.

La valeur de systemSound doit être l’un des membres partagés de la SystemSounds classe :

Pour plus d’informations, consultez Lecture de sons.

Disponibilité par type de projet

Type de projet Disponible
Application Windows Oui
Bibliothèque de classes Oui
Application console Oui
Bibliothèque de contrôles Windows Oui
Bibliothèque de contrôles web Non
Service Windows Oui
Site web Non

S’applique à

Voir aussi