0

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

2 Answers 2

4

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".

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.