Windows Form to dll

T

Tiago Marques

Hi all,

I created a windows form, and I want to use it on other applications. To do
that I think that it would be better to create a dll and on the new
applications create a reference to it.
It is almost like a dialogbox.

Is it possible to be done? How?

I'm using c# on visual studio 2005.

Thank you all
 
M

Morten Wennevik [C# MVP]

Tiago Marques said:
Hi all,

I created a windows form, and I want to use it on other applications. To do
that I think that it would be better to create a dll and on the new
applications create a reference to it.
It is almost like a dialogbox.

Is it possible to be done? How?

I'm using c# on visual studio 2005.

Thank you all

Hi Tiago,

To create a dll just change the output type in the project properties to
Class Library. To use the Forms in another project add a reference to your
dll (browse or use project reference if you have both projects in the same
solution) and create the forms as usual.
 
D

DaveL

If the New form is already in a Windows project that has to stay windows
application..

1. Create new Dll Project
2. Copy Form.cs, FormDesigner.cs and form.resx
into the new dll project Folder
3. Add Existing

set the namespace or leave them...
thats all

DaveL
 
T

Tantr Mantr

Hi, Any reason why you cant use the Forms project directly as is? I agree
that you will/might refactor your forms code considering other projects are
now going to use its methods.

You should be able to reference the forms .exe directly in the project you
want to use it.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top