If you're using VS 2008:
First, create a Windows Forms Application project. You can delete the default form that's created (Form1.cs) if you don't plan to use it.
In the Solution Explorer, right-click on the References and select Add Reference. This is the point where you add your custom designed C# DLL.
Now open Program.cs, and in make the following change:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using ****your DLL namespace here****
namespace WindowsFormsApplication2
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new [****your startup form (from the DLL) here****]);
}
}
}
If the DLL contains disconnected forms, you'll probably need to add a class in the winforms project to coordinate the forms behavior.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…