Creating Button in Window Application using F#

This blog shows how to implement Button in F# Window Application.

Write the following code.

open System.Drawing
open
System.Windows.Forms
 

let
form = new Form(BackColor = Color.Pink , Text = "My Window Application")
let
btn=new Button()
btn.Text <- "Ok"
form.Controls.Add(btn)

Application.Run(form)


Output:

button in FSharp

Ebook Download
View all
Learn
View all