Programmerare, skeptiker, sekulärhumanist, antirasist.
Författare till bok om C64 och senbliven lantis.
Röstar pirat.
2009-08-30
Just by typing the open statement, you can use the .NET Framework, or any other referenced libraries. To access the Console type, just add the following line to your source code:
open System
This program uses the built-in library function printfn, and then the WriteLine function to write “Hello world” to the screen.
printfn "Hello world"
open System
Console.WriteLine("Hello world")
So, displaying a message box, is just a matter of adding a reference to System.Windows.Forms, and this is how it could be done:
let x=System.Windows.Forms.MessageBox.Show("Hello world")
Or like so:
open System.Windows
let y=Forms.MessageBox.Show("Hello world")
Or even:
open System.Windows.Forms
let z=MessageBox.Show("Hello world")
Categories: Microsoft .NET
Tags: F#
Bjud mig på en kopp kaffe (20:-) som tack för bra innehåll!
Leave a Reply