Answer the question
In order to leave comments, you need to log in
How to create a DLL containing a form?
Hello everyone) Is it possible to make a dll-library so that it contains a form?
The final task is that I want to make the appearance of the form myself, and I want to display several forms from one program, so I need them all to have one design, and I would like to achieve this through a dll. I write in C# studio.
Answer the question
In order to leave comments, you need to log in
Can. something like that:
сборка dll:
.............
namespace testform
{
public partial class FormDll : Form
{
public FormDll()
{
InitializeComponent();
}
}
}
.............
приложение
Assembly assembly = Assembly.LoadFile("C:\\prg\\testform.dll");
Type type = assembly.GetType("testform.FormDll ");
Form form = (Form)Activator.CreateInstance(type);
form.ShowDialog();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question