Why is Winforms in Mono not opening any window?
I'm trying to use Winforms for a simple application on my Mac in Mono C#,
so far I've tested this code
using System;
using System.Drawing; using System.Windows.Forms;
public class HelloWorld : Form { static public void Main () {
Application.Run (new HelloWorld ()); }
public HelloWorld ()
{
Button b = new Button ();
b.Text = "Click Me!";
b.Click += new EventHandler (Button_Click);
Controls.Add (b);
}
private void Button_Click (object sender, EventArgs e)
{
MessageBox.Show ("Button Clicked!");
}
}
But no window is opening when I test it, any help? I think my question is
specific to Mono.
No comments:
Post a Comment