Question

I have a button class derived from Button()
with position attribute

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

This is my main module that shows a form
It is compiling without any errors, but
not displayed form with button

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)

Prints the following warning

Warning 1   Main module of program is empty: nothing will happen when it is run
Was it helpful?

Solution

If this is not your last file fs in the project, it will not execute when the app starts. You can re-order files using Alt+Up/Alt+Down in VS, or using the context menu on each file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top