DEV Community

dwarfŧ
dwarfŧ

Posted on

6

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay