C#/VB.NET Play System Sound

In order to play one of the system sounds from your C#/VB .NET you can use the ready to use system sounds the Windows uses for common tasks. Basically, there are 5 sounds that Windows presents:

  1. Asterisk
  2. Beep
  3. Exclamation
  4. Hand
  5. Question

Here is a snap example of filling the system sounds to a combo box and play one of them when an item is selected:

        private void Form1_Load(object sender, EventArgs e)

            comboBox1.DisplayMember = "Text";
            comboBox1.ValueMember = "Value";

            var systemSounds = new[]
                new { Text = "Asterisk", Value = System.Media.SystemSounds.Asterisk },
                new { Text = "Beep", Value = System.Media.SystemSounds.Beep },
                new { Text = "Exclamation", Value = System.Media.SystemSounds.Exclamation },
                new { Text = "Hand", Value = System.Media.SystemSounds.Hand },
                new { Text = "Question", Value = System.Media.SystemSounds.Question }

            comboBox1.DataSource = systemSounds;

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

That’s it 🙂

Please note, by default most of the sounds are the same, and you can change them in the System Sounds Properties in the Control Panel.

Relevant Links:

SystemSounds Class

More advanced example of using the Windows System Sounds

Microncode Components and Libraries:

VS/C#/VB “The type exists in both versions” Error

Some .NET libraries or components may use the same type / enum name which can make the Visual Studio compiler generate an error with the message:

“the type exists in both versions”

Visual Studio compiler error

In order to fix that issue, you can do as follow:

  1. Goto References and select one of the libraries that generated this error.
  2. In the Properties change the Alias property to ‘MyAlias’.
  3. Add to the top of the class that used the library:
//Declear the alias name of the library
extern alias MyAlias;

//The rest of your code...
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

That’s it 🙂

From now on you can create a reference to the library like:

MyAlias.TheLibrary.ClassName xyz;

Microncode .NET Libraries on Nuget.org

We have just added our popular libraries from the microncode.com/developers to the Nuget.org community, that means that .NET developers can import and use our libraries from inside Visual Studio, easily, using the Nuget command line.

Here is the profile page of Microncodee

The list of the .NET libraries in the nuget.org

.NET component to burn an Audio CD from standard WAV files

.NET component to rip Audio CDs tracks with FreeDB and ID3 tags support.

.NET component to convert, join and cut many types of audio files.

.NET component to play any type of audio file with a specific format.

.NET component to record audio from any source to many types of audio files.

.NET component to burn DVDs and CDs from files and directories.

Pure FFmpeg Wrapper for C# and VB .NET Framework (WinForm and WPF) and .NET Core.

.NET library to capture a full webpage to JPEG, BMP, GIF and PDF with PhantomJS.

.NET library to record the screen activities to AVI video with sound using C# VB.

.NET library to convert many type of video files, such as AVI, MP4, WMV, FLV.

.NET library to play many types of video files, such as AVI, FLV, MOV, MP4, MPEG.

.NET library to Capture WebCam to Video Files with C# VB .NET.

All the libraries which served us to develop all of our end users products are available for free for free or learning purposes, for commercial or any other use you can order a licence (at reasonable prices). Also the source code of the libraries are also available in a different distribution under the relax ms-pl license.

For any kind of support feel free to e-mail to:


The Microncode.com is now online officially.

The Microncode.com is now official online! The Microncode.com is a website that provides multimedia solutions for end users and for developers.

Most of the products of the Microncode.com are available for FREE for a free usage, if you want to use them for commercial usage you can buy a license.

You can read more of the services that the Microncode.com is providing at the About page:

Here is the the homepage of the Microncode.com

Most of the programs and the components are under the MS-PL relax license 🙂

End users

Our goal is to provide a quality software solution for the desktop environment of Windows OSs that allows the end users to operate their requests fast and easily.

The end users programs we had developed are available for free for a free usage. If you want to use them for commercial purposes, please purchase a license.

Here are the End Users programs for Windows desktop (FREE for free usage) –


All the components and the libraries which served us to develop all of our products are also available to be used by external developers.

We have added the most common components (.NET WinForm) we were developed to GitHub, you can use, update and fix the code for as you wish. Those components are available with C# and VB .NET examples.

You can use those components for FREE for free usage in a freeware software / open source projects.

Here are the WinForm Components that we published to GitHub.com –

.NET component to record audio from any source to many types of audio files.

.NET component to play any type of audio files with a specific format.

.NET component to convert, join and cut many types of audio files.

.NET component to rip the Audio CD tracks with FreeDB and ID3 tags support.

.NET component to play audio CD with audio graph and FreeDB support.

.NET component to burn an Audio CD from standard WAV files.

More components (in the Microncode.com website) can be found here:

Also, we have developed some Console Programs which allows you to operate the major functionality of our products using the command line. You can get them at:


If you need any kind of support for the Microncode.com products and services, feel free to send us a support request mail via:

Add VS6/VB6 components to Visual Studio 2017

Nowadays in 2018, there are still many useful ActiveX components (DLLs and OCXs) that was wrote with the old (and lovely) VS6/VB6 developing environment. Unfortunately, some of those components cannot be use in the earliest versions of Visual Studio because of the DEP (Data Execution Prevention) issue.

Gladly, Microsoft add the ability to use those component in the Visual Studio 2017 easily 🙂

Here are the stages to add the ability to use VS6/VB6 ActiveX component in Visual Studio:

1) Open Visual Studio 2017
2) Click on ‘Get Tools and Features’ in the ‘Tools’ menu.
3) In the ‘Modify’ window click on the ‘Individual Components’ tab.
4) Mark the ‘VC++ 2017 version 15.7 v14.14 latest v141 tools’ option in the list.
5) Click on the ‘Modify’.
6) Wait for Visual Studio 2017 to finish the installation.
7) Open the project that you want to add the VS6/VB6 components.
8) Go to the project properties.
9) Click on the ‘Build Events’ tab.
10) Add the above command to the ‘Post Build’:

call "$(DevEnvDir)..\tools\vsdevcmd.bat"

"$(DevEnvDir)....\VC\Tools\MSVC\14.13.26128\bin\Hostx86\x86\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"

Get Tools and Features in Visual Studio 2017
Get Tools and Features in Visual Studio 2017

That’s It 🙂

From now on you can use the VS6/VB6 components in your Visual Studio 2017 projects.


  • This demonstrate use Visual Studio C# project, you can also do the same with Visual Basic or any other desktop language of the Visual Studio 2017.
  • You can change the command $(DevEnvDir) in the Build Events to the location of the Visual Studio 2017 in your hard drive.