Sound

RadDesktopAlert allows you to play a sound when the alert is shown.

To enable this, set the Sound property of RadDesktopAlert. The property of type SystemSound and expects one of the default sounds coming from the SystemSounds class.

Example 1: Show desktop alert with sound

void ShowAlert() 
{ 
    var alert = new RadDesktopAlert(); 
    alert.Header = "MAIL NOTIFICATION"; 
    alert.ShowDuration = 3000; 
    alert.Sound = System.Media.SystemSounds.Beep; 
 
    RadDesktopAlertManager manager = new RadDesktopAlertManager(); 
    manager.ShowAlert(alert); 
} 
Additionally, you can implement logic that plays a custom sound by overridding the PlaySound method of RadDesktopAlert.

Example 2: Play custom sound

public class CustomDesktopAlert : RadDesktopAlert 
{ 
    protected override void PlaySound() 
    { 
        string soundFilePath = "../../mySound.wav"; 
        System.Media.SoundPlayer player = new System.Media.SoundPlayer(soundFilePath); 
        player.Load(); 
        player.Play(); 
    } 
} 

See Also

In this article
Not finding the help you need? Improve this article