Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-play-a-beep-from-a-windows-form.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

1.2 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Play a Beep from a Windows Form 03/30/2017
csharp
vb
sounds [Windows Forms], beep
Windows Forms, sounds
sounds [Windows Forms], playing
forms [Windows Forms], sounds
examples [Windows Forms], sounds
7ea5cded-4888-4f35-8f28-5cab1a55c973

How to: Play a Beep from a Windows Form

This example plays a beep at run time.

Example

Public Sub OnePing()
    Beep()
End Sub
public void onePing()
{
    SystemSounds.Beep.Play();
}

Note

The sound played in the C# code sample is determined by the xref:System.Media.SystemSounds.Beep%2A system sound setting. For more information, see xref:System.Media.SystemSounds.

Compiling the Code

For C#, this example requires a reference to the xref:System.Media?displayProperty=nameWithType namespace.

See also