Creating Button in Window Application using F#

Here, we will learn to implement Button in F# Window Application.

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