DEV Community

dwarfŧ
dwarfŧ

Posted on

create a windows form in c# without visual studio

step 1
intall c# and the mono compiler

step 2
next we need to write the code. This will make a blank window appear:

using System;
using System.Drawing;
using System.Windows.Forms;

public class app : Form
{
    static public void Main ()
    {
        Application.Run (new app ());
    }
}
Enter fullscreen mode Exit fullscreen mode

step 3
we can compile this with:
mcs main.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll
or:
csc main.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll

next run it with mono main.exe. Boom! We have a window!

step 4
enjoy and have a good day!

Top comments (0)