WinForm Programming: A Basic WinForm Application
June 18, 2007 – 8:54 pmLet me get this week started with a basic example of WinForm application. I know, i should’ve done a smoother transition from coldfusion to c#, but it has been a tough week understanding with so much less community work in coldfusion communities.
Here is our C# application code:
using System;
using System.Windows.Forms;
public class WinApp : Form {
public static void Main() {
Form w = new WinApp();
Application.Run(w);
}
}
When you run this piece of code, it should launch a new blank window, which is really a basic WinForm.
Let me explain this code a little.
- Form is a .net basic class which provides windowing functionality.
- WinApp is a class name, followed by braces {},
- using System.Windows.Forms; is a .net namespace
Try running the code, it should be familiar
Tags: c#, windows application