473,382 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Windows Form to dll

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
4 23252
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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hamed | last post by:
Hello I have employed as a developer in a software company that its team uses FoxPro / VB 6.0 / VC++ 6.0 as the developing tools and newly is going to migrate to VS.NET. There is a project...
5
by: Xarky | last post by:
Hi, I am creating a windows form, and when a specified event occurs (button click), I am hiding the windows form and opening a new windows form. When opening the new windows form and closing...
5
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to exit the app, or load a new file, without saving...
9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
4
by: Michael C# | last post by:
I have a Windows Form I want to add to another form similar to the way you add an OpenFileDialog to a Windows Form from the Toolbox. Thx
6
by: Dean R. Henderson | last post by:
I have a DTS Package I am able to execute successfully from a Windows Form application, but I cannot get this to work from an ASP.NET Web Service, although the Web Service impersonates the same...
8
by: Alison | last post by:
Hi, Al I am trying to design a user interface which provides both menus and toolbars for some users to click on whatever they want to do, at the same time, I would like to have a console window...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
9
by: mohit.akl | last post by:
Hey guys & gals I am havng trouble modifying the control box. I want to make the maximise button invisible and have minimisise button instead of it. Like this _ X (not like _ o X ) How...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.