open System open System.Drawing open System.Windows.Forms let form = new Form(Text = "Hello World", BackColor = Color.Blue, TopMost = true) form.Show() let helloButtonClick = EventHandler(fun _ _ -> MessageBox.Show("Hello World") |> ignore) let button = new Button(Text = "Hello World") button.Click.AddHandler(helloButtonClick) form.Controls.Add(button) form.Text <- "Goodby World" form.BackColor <- Color.Pink button.Text <- "Goodby World" let goodbyButtonClick = EventHandler(fun _ _ -> MessageBox.Show("Goodby World") |> ignore) button.Click.RemoveHandler(helloButtonClick) button.Click.AddHandler(goodbyButtonClick) button.Width <- 100;; button.Top <- 100;; button.Left <- 90;;