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

Importing form GUI from another project

P: n/a
I need to import the Winform GUI from one project to another(with all the
controls).
Is there a simple way to copy&paste it or must I create every control by
hand

Regards
Ronny
Jul 13 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hello Ronny,
I need to import the Winform GUI from one project to another(with all
the
controls).
Is there a simple way to copy&paste it or must I create every control
by
hand
Regards
Ronny
I think you can copy& paste, do you encounter any issues?

Thanks,
J.W.
Jul 13 '08 #2

P: n/a
On Sun, 13 Jul 2008 06:37:42 -0700, Ronny <ro***@giron.comwrote:
I need to import the Winform GUI from one project to another(with all the
controls).
Is there a simple way to copy&paste it or must I create every control by
hand
As J.W. say, you should be able to just copy/paste. Have you tried that?

That said, you may find that it makes more sense to factor the Form
sub-class out into a separate assembly and then reference it from whatever
projects you want to use it. You can use copy/paste in doing that as
well, but you may find it easier to just create a new empty project, copy
the source .cs files into the new project's directory (don't forget the
Designer file(s)), and then use the "Add Existing Item..." command to add
the source files to your empty project.

If you simply share the Form as a separate assembly, then when you find
and fix a bug while working on one project that uses it, you won't have to
go back and make the same fix to the other project that uses it. :)

Pete
Jul 13 '08 #3

P: n/a
Hello Ronny,

Right click on the solution --Add--Existing project inside Visual Stuido.

Or just compile you GUI project in dll and add the reference to it.

Kind regards,
Andrei Varanovich [C# MVP]
I need to import the Winform GUI from one project to another(with all
the
controls).
Is there a simple way to copy&paste it or must I create every control
by
hand
Regards
Ronny

Jul 13 '08 #4

P: n/a
Thanks,
Please note
1.the source project is an executable
2. my current project is a dll clas library
3. I can't simply add it to the project. I have to import its form and the
form controls.

Regards
Ronny


Jul 14 '08 #5

P: n/a
On Sun, 13 Jul 2008 22:41:40 -0700, Ronny <ro***@giron.comwrote:
Thanks,
Please note
1.the source project is an executable
You can add references to .exe files.
2. my current project is a dll clas library
Even in DLL projects.
3. I can't simply add it to the project. I have to import its form and
the
form controls.
Adding a reference to any executable (DLL or EXE) to some other project
will have the effect of importing all public classes in that executable
into the project to which the reference was added.

Not that I am actually suggesting you do it that way. But you could
follow Andrei's first suggestion if you wanted.

Obviously, I would follow my own advice (which is identical to Andrei's
second suggestion). Factor the form out into its own DLL project and
reference that DLL from any project in which you want to use the form
itself.

Pete
Jul 14 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.