open System
open System.Windows.Forms
open System.ComponentModel
open System.Drawing
let calcform=new Form(Text="Find Area of Annulus")
calcform.BackColor<-Color.DarkGray
let lrgcirclbl=new Label(Top=20,Left=0,Width=120)
lrgcirclbl.Text<-"Area of a large circle:"
let largecircletxt=new TextBox(Top=20,Left=130)
let smllbl=new Label(Top=60,Left=0,Width=120)
smllbl.Text<-"Area of a small circle"
let smallcircletxt=new TextBox(Top=60,Left=130)
let annuluslbl=new Label(Top=100,Left=20,Width=120)
annuluslbl.Text<-"Area of an annulus:"
let resultlbl=new Label(Top=100,Left=140,BorderStyle=BorderStyle.FixedSingle)
let computebutton=new Button(Top=140,Left=70,Width=80)
computebutton.Text<-"Calculate"
computebutton.BackColor<-Color.Ivory
let exitbutton=new Button(Top=140,Left=160,Width=60)
exitbutton.Text<-"Exit"
exitbutton.BackColor<-Color.Ivory
calcform.Controls.Add(lrgcirclbl)
calcform.Controls.Add(largecircletxt)
calcform.Controls.Add(smllbl)
calcform.Controls.Add(smallcircletxt)
calcform.Controls.Add(annuluslbl)
calcform.Controls.Add(resultlbl)
calcform.Controls.Add(computebutton)
calcform.Controls.Add(exitbutton)
computebutton.Click.Add(fun find ->
let areaoflargecircle=Convert.ToDouble(largecircletxt.Text)
let areaofsmallcircle=Convert.ToDouble(smallcircletxt.Text)
let areaofannulus=areaoflargecircle-areaofsmallcircle
resultlbl.Text<-Convert.ToString(areaofannulus))
exitbutton.Click.Add(fun exit -> calcform.Close())
Application.Run(calcform)