Audio.PlaySystemSound(SystemSound) Metod

Definition

Spelar upp ett systemljud.

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)

Parametrar

systemSound
SystemSound

SystemSound objekt som representerar det systemljud som ska spelas upp.

Undantag

systemSound är Nothing.

Exempel

I det My.Computer.Audio.PlaySystemSound här exemplet används metoden för att spela upp ett systemljud.

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

Det här kodexemplet kan bara köras i ett Windows Forms program.

Kommentarer

Metoden PlaySystemSound spelar upp systemljudet som beskrivs av systemSound; ljudet spelas upp en gång i bakgrunden.

Värdet systemSound för måste vara en av de delade medlemmarna från SystemSounds klassen:

Mer information finns i Spela upp ljud.

Tillgänglighet efter projekttyp

Projekttyp Tillgängligt
Windows-program Yes
Klassbibliotek Yes
Konsolprogram Yes
Windows-kontrollbibliotek Yes
Webbkontrollbibliotek No
Windows-tjänsten Yes
Webbplats No

Gäller för

Se även