Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

PlaySystemSound Method

Location

My.Computer.Audio.PlaySystemSound

Syntax

My.Computer.Audio.PlaySystemSound(systemSound)

systemSound (required; SystemSound enumeration)

The system sound to play. One of the following System.Media.SystemSounds enumeration values.

Value

Description

Asterisk

The sound played with an "asterisk" message box

Beep

The default system "beep" sound

Exclamation

The sound played with an "exclamation" message box

Hand

The sound played with a "hand" message box

Question

The sound played with a "question" message box

Description

The PlaySystemSound method plays a system sound, one of the sounds linked to a specific system-initiated action. The sound is played in the background one time.

Usage at a Glance

  • This method is only valid in non-server applications.

  • Specifying an invalid system sound will cause an exception.

Example

The following example plays the system "Beep" sound.

My.Computer.Audio.PlaySystemSound( _ System.Windows.Forms.SystemSounds.Beep)

Related Framework Entries

  • Microsoft.VisualBasic.Devices.Audio.PlaySystemSound Method

  • System.Media.SystemSound Class

  • System.Media.SystemSound.Play Method

  • System.Media.SystemSounds Class

See Also

Audio Object, Play Method, Stop Method

Категории