Task

Create a window that has:

   a label that says   "There have been no clicks yet" 
   a button that says   "click me"


Upon clicking the button with the mouse, the label should change and show the number of times the button has been clicked.




open System.Windows.Forms
 
let mutable clickCount = 0
 
let form = new Form()
 
let label = new Label(Text = "There have been no clicks yet.", Dock = DockStyle.Top)
form.Controls.Add(label)
 
let button = new Button(Text = "Click me", Dock = DockStyle.Bottom)
button.Click.Add(fun _ ->
    clickCount <- clickCount+1
    label.Text <- sprintf "Number of clicks: %i." clickCount)
form.Controls.Add(button)
 
Application.Run(form)