Hello F#
最近专门抽了一些时间大概了解了一下F#,对里面的类型定义,事件声明绑定等进行了
#
light
open System.Windows.Forms type MyForm= inherit Form val l:Label val b:Button member t.InitializeComponent()= t.Text <- " F#Sample " t.Controls.Addt.l t.Controls.Addt.b t.b.Click | >Event.listen( fun evArgs -> t.l.Text <- t.l.Text+ " 您好! " ) new () as t= { b= new Button(Text= " 点击 " ,Location= new System.Drawing.Point( 100 , 128 )) l= new Label(Text= " 显示信息: " , 100 ),Size= new System.Drawing.Size( 200 , 20 )) } then t.InitializeComponent() let form1= new MyForm(Visible= true ,TopMost= true ) do Application.Run(form1)
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |