我有一个从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
答案 0 :(得分:0)
如果这不是项目中的最后一个文件fs,它将在应用程序启动时执行。您可以使用VS中的Alt + Up / Alt + Down重新排序文件,或使用每个文件的上下文菜单。