Audio.PlaySystemSound(SystemSound) Método

Definición

Reproduce un sonido del sistema.

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)

Parámetros

systemSound
SystemSound

SystemSound objeto que representa el sonido del sistema que se va a reproducir.

Excepciones

systemSound es Nothing.

Ejemplos

En este ejemplo se usa el My.Computer.Audio.PlaySystemSound método para reproducir un sonido del sistema.

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

Este ejemplo de código solo se puede ejecutar dentro de una aplicación de Windows Forms.

Comentarios

El PlaySystemSound método reproduce el sonido del sistema descrito por systemSound; el sonido se reproduce una vez, en el fondo.

El valor de systemSound debe ser uno de los miembros compartidos de la SystemSounds clase :

Para obtener más información, vea Reproducir sonidos.

Disponibilidad por tipo de proyecto

Tipo de proyecto Disponible
Aplicación Windows Yes
Biblioteca de clases Yes
Aplicación de consola Yes
Biblioteca de controles de Windows Yes
Biblioteca de controles web No
Servicio de Windows Yes
Sitio web No

Se aplica a

Consulte también