Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Audio.PlaySystemSound(SystemSound) Method
Definition
- Namespace:
- Microsoft.VisualBasic.Devices
- Assembly:
- Microsoft.VisualBasic.dll
- Assembly:
- Microsoft.VisualBasic.Forms.dll
- Source:
- Audio.vb
- Source:
- Audio.vb
- Source:
- Audio.vb
- Source:
- Audio.vb
- Source:
- Audio.vb
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Plays a system sound.
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)
Parameters
- systemSound
- SystemSound
SystemSound object representing the system sound to play.
Exceptions
systemSound is Nothing.
Examples
This example uses the My.Computer.Audio.PlaySystemSound method to play a system sound.
Sub PlaySystemSound()
My.Computer.Audio.PlaySystemSound(
System.Media.SystemSounds.Asterisk)
End Sub
This code example can run only within a Windows Forms application.
Remarks
The PlaySystemSound method plays the system sound described by systemSound; the sound is played once, in the background.
The value of systemSound must be one of the shared members from the SystemSounds class:
For more information, see Playing Sounds.
Availability by Project Type
| Project type | Available |
|---|---|
| Windows Application | Yes |
| Class Library | Yes |
| Console Application | Yes |
| Windows Control Library | Yes |
| Web Control Library | No |
| Windows Service | Yes |
| Web Site | No |
Applies to
See also
Feedback
Was this page helpful?
