I've been given some code that is in effect a class library with a Winform module. Obviously I cannot run the class library directly.
Is there anyway that I can 'run' it so that I can see what the form will look like when run? 开发者_开发技巧I need to check anchoring/docking, etc?
Thanks
Make a new WinForms project, reference the Module, create an instance of the form and show it:
using WfModule;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new WfModuleForm());
}
}
}
Assuming your DLL is called "WfModule.Dll" and the form is called "WfModuleForm".
You should be able to create a new winforms project (an EXE, not a DLL), add the DLL library as a reference, and then instantiate and show an instance of the form defined in the DLL library.
精彩评论