level 6
凌寒树
楼主
F# Hello Word 程序
(* This is commented *)
(* Sample hello world program *)
printfn "Hello World!"
F# Winforms 程序
#light (* Sample Windows Forms Program *)
(* We need to open the Windows Forms library *)
open System.Windows.Forms
(* Create a window and set a few propertis *)
let form = new Form
(Visible=true, TopMost=true, Text="Welcome to F#")
(* Create a label to show some text in the form *)
let label = let
temp = new Label()
let x = 3 + (4 * 5)
(* Set the value of the Text*)
temp.Text <- sprintf "x = %d" x
(* Remember to return a value! *)
temp
(* Add the label to the form *)
do form.Controls.Add(label)
(* Finally, run the form *)
[<STAThread>]
do Application.Run(form)
2010年08月29日 03点08分
1
(* This is commented *)
(* Sample hello world program *)
printfn "Hello World!"
F# Winforms 程序
#light (* Sample Windows Forms Program *)
(* We need to open the Windows Forms library *)
open System.Windows.Forms
(* Create a window and set a few propertis *)
let form = new Form
(Visible=true, TopMost=true, Text="Welcome to F#")
(* Create a label to show some text in the form *)
let label = let
temp = new Label()
let x = 3 + (4 * 5)
(* Set the value of the Text*)
temp.Text <- sprintf "x = %d" x
(* Remember to return a value! *)
temp
(* Add the label to the form *)
do form.Controls.Add(label)
(* Finally, run the form *)
[<STAThread>]
do Application.Run(form)