mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-07 07:56:07 +02:00
* 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
1.5 KiB
1.5 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| How to: Play a Sound Embedded in a Resource from a Windows Form | 03/30/2017 |
|
|
7d148bb6-8a1e-47d7-a08d-35828d2e688f |
How to: Play a Sound Embedded in a Resource from a Windows Form
You can use the xref:System.Media.SoundPlayer class to play a sound from an embedded resource.
Example
[!code-csharpSystem.Windows.Forms.Sound#10] [!code-vbSystem.Windows.Forms.Sound#10]
Compiling the Code
This example requires:
Importing the xref:System.Media?displayProperty=nameWithType namespace.
Including the sound file as an embedded resource in your project.
Replacing "<AssemblyName>" with the name of the assembly in which the sound file is embedded. Do not include the ".dll" suffix.