473,385 Members | 1,506 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,385 software developers and data experts.

How to design a large .NET Project - Reuse Components

We are planning a greater .NET Application-System (WindowsForms) with
Visual Studio 2005.

One of my problem is, how to design the objects, that they can be
reused.

E.g. I have a form (with derived textboxes) that should be used in
several Projects.

I tried to copy the form to the other project - with no success.
Adding as a linked component didnīt work, too.

Do I have to work with UserControls and dlls? How about updates.

Who has experience in such things.

Thanks for help
aaapaul

Oct 18 '07 #1
11 1290
On 18/10/2007 in message
<11*********************@i38g2000prf.googlegroups. comaaapaul wrote:
>I tried to copy the form to the other project - with no success.
Adding as a linked component didnīt work, too.
Either of those approaches *should* work, linking is probably better since
you only have to modify/update the form once.

Is it the main form in each app? If so you should delete the 'Form1' that
VS automatically adds and set your form as the startup form.
--
Jeff Gaines
Oct 18 '07 #2
Thanks Jeff, but I donīt understand your answer.

Let me give you more details.

In VB6 ist was possible to use the same form in several projects:

sample
c:\vb6\p1\
c:\vb6\p2\
c:\vb6\common

I had a frmUni in c:\vb6\common and I could use it in p1 and p2 - I
simple added it to the projects.

Isntīt this possible in .NET any more?

Outer solutions?

Thanks

Oct 18 '07 #3
"aaapaul" <lv****@gmx.netwrote in message
news:11*********************@i38g2000prf.googlegro ups.com...
We are planning a greater .NET Application-System (WindowsForms) with
Visual Studio 2005.

One of my problem is, how to design the objects, that they can be
reused.

E.g. I have a form (with derived textboxes) that should be used in
several Projects.

I tried to copy the form to the other project - with no success.
Adding as a linked component didnīt work, too.

Do I have to work with UserControls and dlls? How about updates.

Who has experience in such things.

Thanks for help
aaapaul
Are the forms to be reused in projects within the same solution, or are they
in different solutions?
If the projects are in a common solution copying is simple and
semi-automatic (select the <formname>.vb to copy and the support files are
automatically copied as well), and adding a link to another project is also
straight forward (right-click on project in solution explorer->Add
reference...).
If you have separate solutions that's a different matter.

Oct 18 '07 #4
Thanks.

The problem appears only when I am using a derived control on the box.

I have a solution with
project 1
and
project 2

In project1 there is a form1 that I want to use in project2

So I added in project2 a reference to form1 from project1.

This works.

But when I place a derived textbox (ltext1) on form1.

The error "project1.ltext1 is not defined" appears.

Any idea?

Thanks.

Oct 18 '07 #5

If you're serious about it, then I'd recommend
http://www.amazon.com/Developing-App...ion/1590592883

He gives you a good understanding of what you're actually doing and provides
some code.
Most is germane to 1.1, but the concepts apply to whatever version/language
you use.
Read the reviews on the amazon site.

"aaapaul" <lv****@gmx.netwrote in message
news:11*********************@i38g2000prf.googlegro ups.com...
We are planning a greater .NET Application-System (WindowsForms) with
Visual Studio 2005.

One of my problem is, how to design the objects, that they can be
reused.

E.g. I have a form (with derived textboxes) that should be used in
several Projects.

I tried to copy the form to the other project - with no success.
Adding as a linked component didnīt work, too.

Do I have to work with UserControls and dlls? How about updates.

Who has experience in such things.

Thanks for help
aaapaul
Oct 18 '07 #6
"aaapaul" <lv****@gmx.netwrote in message
news:11**********************@y27g2000pre.googlegr oups.com...
Thanks.

The problem appears only when I am using a derived control on the box.

I have a solution with
project 1
and
project 2

In project1 there is a form1 that I want to use in project2

So I added in project2 a reference to form1 from project1.

This works.

But when I place a derived textbox (ltext1) on form1.

The error "project1.ltext1 is not defined" appears.

Any idea?

Thanks.
Where, exactly, is your subclass of TextBox? In project1, perhaps?
What happens if you add a reference to your subclass to project 2?

Oct 18 '07 #7
The Subclass of the Textbox is in Project1 as a reference of Project3
(ltext.vb).

I added the Reference (ltext.vb) to Project2 too, with no success.

Error in Project2: Project1.LText is not defined.

Thanks.

Oct 19 '07 #8
Thanks Sujith!

I did it like you described it.

I have now project1 and project2 in one solution.
I added in project2 a reference to application1 and I said

Dim x As New Project1.Form1()
x.ShowDialog()

This works.

But now I have 2 exe and cant start one exe without the other.

I only wanted to complie the form1 of Project1 in Project 2.

Its seems, thats this behavior is not so good like in VB6

Oct 19 '07 #9
In reading some of your other posts it sounds like what you are trying to
do is reference the actual source files from multiple projects directly
within the other projects. The better method is to create multiple class
library projects (.dlls) and reference the dlls in the other projects. Any
classes (and a form is just a class) that needs to be used by your other
projects needs to be made public.

--
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com
"aaapaul" <lv****@gmx.netwrote in message
news:11*********************@i38g2000prf.googlegro ups.com...
We are planning a greater .NET Application-System (WindowsForms) with
Visual Studio 2005.

One of my problem is, how to design the objects, that they can be
reused.

E.g. I have a form (with derived textboxes) that should be used in
several Projects.

I tried to copy the form to the other project - with no success.
Adding as a linked component didnīt work, too.

Do I have to work with UserControls and dlls? How about updates.

Who has experience in such things.

Thanks for help
aaapaul

Oct 21 '07 #10
Okay,

I guess, you don't want to reuse the form1 in its compiled form. You just
want to add an existing form in "project1" to "project2". Is that so?
(Sorry, if i am wrong).
Adding an existing form in one project to another is possible as follows
Take solution explorer.
Select project, right mouse button, Select Add existing item, browse the
filesystem and select the form1 (which is residing at the project folder of
"Project1").
This when compiled creates only one executable, project2.exe.

Let me know whether this was the solution you were lookin for.

Regards
Sujith
"aaapaul" <lv****@gmx.netwrote in message
news:11**********************@e9g2000prf.googlegro ups.com...
Thanks Sujith!

I did it like you described it.

I have now project1 and project2 in one solution.
I added in project2 a reference to application1 and I said

Dim x As New Project1.Form1()
x.ShowDialog()

This works.

But now I have 2 exe and cant start one exe without the other.

I only wanted to complie the form1 of Project1 in Project 2.

Its seems, thats this behavior is not so good like in VB6

Oct 22 '07 #11
Thanks Sujith !

I think this is the solution.

Changing the namespace is not good, because the namespace ist in the
other project wrong than.

But if I delete a part of the namespace.

project1.ltext -simple ltext.

It worksīin both projects.

Programming could be so simple ....

Thanks all
aaapaul

Oct 23 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Eric Veltman | last post by:
Hello everyone, I've posted this question before, but got no answer, so I'll try to reformulate the question, maybe it helps :-) By the way, this is not intended as the start of an ASP.NET...
43
by: grz02 | last post by:
Hi, Im an experienced database+software designer and developer, but, unfortunately, anything to do with web-programming and web-systems designs is still a pretty new area to me... (been working...
9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
2
by: Kymert persson | last post by:
Hi. I was wondering if there are any more C++ books along the lines of "Large scale C++ software design" by Lakos, J. I.e. concerning larger design issues in close relation to C++. I have made a...
6
by: patrick t music-images dt nl | last post by:
Hi, I'm evaluating Visual Studio and the .NET concept for his company, which is currently using Borland C++ Builder. Now I tried to create components/controls etc. in .NET and I can reuse it...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
2
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, We have one product. It is client/server based application. We have developed client application in VC++ 6.0. Our client is desktop based application like dialog based application....
3
by: Mike TI | last post by:
Aug 2, 2007 12:00pm Hi all I have to design and program an application which will be used in three countries. It would be a fairly large application with lot of data entry. The database...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.