// The minimum required namespaces.
using System;
using System.Windows.Forms;
namespace SimpleWFApp
{
// This is our application object.
class Program
{
static void Main()
{
Application.Run(new MainWindow());
}
}
// This is our main window.
class MainWindow : Form {}
}
This code represents the absolute simplest Windows Forms application. At bare minimum,
we need a class type that extends the Form base class and a Main() method to call the static
Application.Run() method (more details on Form and Application later in this chapter). You can
compile this application using the following command set (recall from Chapter 2 that the default
response file [csc.rsp] automatically references numerous .NET assemblies, including System.
Windows.Forms.dll and System.Drawing.dll):
csc /target:winexe *.cs
Do'stlaringiz bilan baham: |