Simple Windows Form in C#

Minimal code to write a c# windows form:

using System.Windows.Forms;

namespace ConsoleFormApp
{
    class MyWindow : Form
    {
        public MyWindow()
        {
            this.Text = "First Form";
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Application.Run(new MyWindow());
        }
    }
}
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s