我有一个从具有位置属性的 Button() 派生的按钮类
namespace fgame15
open System
open System.Windows.Forms
open System.Drawing
module Game15Button =
type Game15Button(position:Point) as button =
inherit Button()
member this.Pozition = position
这是我的主要模块,显示一个表单
它正在编译没有任何错误,但
没有显示带有按钮的表单
namespace fgame15
open System
open System.Drawing
open System.Windows.Forms
module Main =
do
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)
打印以下警告
Warning 1 Main module of program is empty: nothing will happen when it is run