How to play Beep in window application

If you want to play beep sound on the few some situation such as at the time of the application start up or at the time of displaying an error message or any notification in the application. You can use Beep property of the System.Media.SystemSounds class. Beep sound depends on the current Windows sound scheme.


The following example will show how we can use Beep property at the time of windows form load.


Private Sub Form1_Load(ByVal sender As System.Object,
                           ByVal e As System.EventArgs) Handles MyBase.Load
End Sub


private void Form1_Load(object sender, EventArgs e)

You can use the above code of line where you want to play the beep sound.