Live Chat Icon For mobile
Live Chat Icon

How do I beep the computer’s speaker in a Windows Form application

Platform: WinForms| Category: Tips

There is no Windows Form function to beep your computer’s speaker. But you can just invoke the Win32 API MessageBeep.

	using System.Runtime.InteropServices; 
	public static extern int MessageBeep(uint n); 
	private void button2_Click(object sender, System.EventArgs e)

Another method (suggested by on microsoft.public.dotnet.framework.windowsforms)

Reference the VB.NET runtime support and just use the Beep() method.

The method is in:

Microsoft.Visual Basic.NET Runtime

The method is:


Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.