Stops playback of the sound if playback is occurring.
public void Stop()
The following code example demonstrates the use of the Stop method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the SoundPlayer class.
ReportStatus("Stopped by user.");
for access to native code. Associated enumeration: UIPermissionWindow.SafeSubWindows
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2