By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,286 Members | 2,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,286 IT Pros & Developers. It's quick & easy.

Windows Form to dll

P: n/a
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
Nov 6 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Thu, 06 Nov 2008 05:50:00 -0800, Tiago Marques
<Ti**********@discussions.microsoft.comwrote:
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?
The same way you'd deploy any C# class in a DLL. Just write the project
containing the class, set the output type for the project to DLL, and then
reference the DLL in whatever other project you want to use it.

Pete
Nov 6 '08 #2

P: n/a

"Tiago Marques" wrote:
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.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 6 '08 #3

P: n/a
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
"Tiago Marques" <Ti**********@discussions.microsoft.comwrote in message
news:EF**********************************@microsof t.com...
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

Nov 6 '08 #4

P: n/a
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
"Morten Wennevik [C# MVP]" wrote:
>
"Tiago Marques" wrote:
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.

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 10 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.