open System
open System.Windows.Forms
open System.ComponentModel
open System.Drawing
let RecPrismForm=new Form(Text="Rectangular prism volume")
RecPrismForm.BackColor<-Color.Bisque
//enter the length value
let lengthlbl=new Label(Top=10,Left=0,Width=130)
lengthlbl.Text<-"Enter Length value:"
let lenghttxtbox=new TextBox(Top=10,Left=140,Width=80)
//enter the width value
let widthlbl=new Label(Top=40,Left=0,Width=130)
widthlbl.Text<-"Enter Width value:"
let widthtxtbox=new TextBox(Top=40,Left=140,Width=80)
//enter the height value
let heightlbl=new Label(Top=70,Left=0,Width=130)
heightlbl.Text<-"Enter Height Value:"
let heighttxtbox=new TextBox(Top=70,Left=140,Width=80)
//after compute prism volume displayed here
let pvolumelbl=new Label(Top=120,Left=80,Width=80)
pvolumelbl.Text<-"Prism Volume:"
let prismvolumelabel=new Label(Top=120,Left=180,BorderStyle=BorderStyle.FixedSingle)
//create buttons
let manipulatebtn=new Button(Top=180,Left=120,Width=80)
manipulatebtn.BackColor<-Color.Ivory
manipulatebtn.Text<-"Compute"
let exitbutton=new Button(Top=180,Left=220,Width=80)
exitbutton.BackColor<-Color.Ivory
exitbutton.Text<-"Exit"
//adding the controls in form
RecPrismForm.Controls.Add(lengthlbl)
RecPrismForm.Controls.Add(lenghttxtbox)
RecPrismForm.Controls.Add(widthlbl)
RecPrismForm.Controls.Add(widthtxtbox)
RecPrismForm.Controls.Add(heightlbl)
RecPrismForm.Controls.Add(heighttxtbox)
RecPrismForm.Controls.Add(pvolumelbl)
RecPrismForm.Controls.Add(prismvolumelabel)
RecPrismForm.Controls.Add(manipulatebtn)
RecPrismForm.Controls.Add(exitbutton)
//Manipulate the prism valume
manipulatebtn.Click.Add(fun compute->
let lenghtvalue=Convert.ToDouble(lenghttxtbox.Text)
let widthvalue=Convert.ToDouble(widthtxtbox.Text)
let heightvalue=Convert.ToDouble(heighttxtbox.Text)
let prismvol=lenghtvalue*widthvalue*heightvalue
prismvolumelabel.Text<-Convert.ToString(prismvol))
exitbutton.Click.Add(fun exit -> RecPrismForm.Close())
Application.Run(RecPrismForm)