open System
open System.Media
open System.Drawing
open System.Windows.Forms
let myform=new Form(Text="System Sounds")
myform.BackColor<-Color.BlanchedAlmond
let soundlbl=new Label(Top=20,Left=60,Width=120)
soundlbl.Text<-"Play System Sounds"
//Asterik sound
let btnAsterik=new Button(Top=70,Left=60,Width=120)
btnAsterik.Text<-"Asterik Sound"
btnAsterik.BackColor<-Color.Ivory
btnAsterik.Click.Add(fun sound->
SystemSounds.Asterisk.Play()
MessageBox.Show("Asterisk", "Play Asterik Sounds", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)|>ignore)
//Beep sound
let btnBeep=new Button(Top=100,Left=60,Width=120)
btnBeep.Text<-"Beep Sound"
btnBeep.BackColor<-Color.Ivory
btnBeep.Click.Add(fun sound->
SystemSounds.Beep.Play()
MessageBox.Show("Beep", "Play Beep Sounds", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)|>ignore)
//Exclamation sound
let btnExclamation=new Button(Top=130,Left=60,Width=120)
btnExclamation.Text<-"Exclamation Sound"
btnExclamation.BackColor<-Color.Ivory
btnExclamation.Click.Add(fun sound->
SystemSounds.Exclamation.Play()
MessageBox.Show("Exclamation", "Play Exclamation Sounds", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)|>ignore)
//Hand sound
let btnHand=new Button(Top=160,Left=60,Width=120)
btnHand.Text<-"HAND Sound"
btnHand.BackColor<-Color.Ivory
btnHand.Click.Add(fun sound->
SystemSounds.Hand.Play()
MessageBox.Show("HAND", "Play HAND Sounds", MessageBoxButtons.OK, MessageBoxIcon.Hand)|>ignore)
//Question sound
let btnQuestion=new Button(Top=190,Left=60,Width=120)
btnQuestion.Text<-"Question Sound"
btnQuestion.BackColor<-Color.Ivory
btnQuestion.Click.Add(fun sound->
SystemSounds.Hand.Play()
MessageBox.Show("Question", "Play Question Sounds", MessageBoxButtons.OK, MessageBoxIcon.Question)|>ignore)
//addind controls to the form
myform.Controls.Add(soundlbl)
myform.Controls.Add(btnAsterik)
myform.Controls.Add(btnBeep)
myform.Controls.Add(btnExclamation)
myform.Controls.Add(btnHand)
myform.Controls.Add(btnQuestion)
myform.Show()
Application.Run(myform)