How to Get System Sounds in C sharp:
There are several types of system sounds in Operating system.Today we are going to learn how to get them.
lets get started in simple steps.
Step 1:
Start a new (Windows form Application) project in C sharp.
Step 2:
Add five buttons on your C sharp Form as shown below,
Step 3:
Now double click on button 1 to give some code to it.
Step 4:
Type the following code under button 1
System.Media.SystemSounds.Hand.Play();
Step 5:
Now double click on button 2 and give the following code to button 2.
System.Media.SystemSounds.Beep.Play();
Step 6:
Now double click on button 3 and give the following code to button 3.
System.Media.SystemSounds.Asterisk.Play();
Step 7:
Now double click on button 4 and give the following code to button 4.
System.Media.SystemSounds.Question.Play();
Step 8:
Now double click on button 5 and give the following code to button 5.
System.Media.SystemSounds.Exclamation.Play();
Step 9:
Finally your program should look like this.
Now Run your program and enjoy.
feel free to contact me at any time for any type of question regarding C Sharp.


No comments:
Post a Comment