Windows Form to dll

  • Thread starter Thread starter Tiago Marques
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top