473,508 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

One solution, 2 projects and one problem

Hi

In one solution I have 2 projects. One project is containing the windows
form and the other conatins a public class returning a string... "Greetings
from Norway :-)"

How can I show the "greetings from Norway :-)" string in the solution with
the form...?

Any tip/trick or help appreciates.

Best regard
Hans Årsjö

Feb 13 '07 #1
5 1460
In your project with the form, add a reference to the project with the
string. If the string is a static public member of the second project,
then after adding the reference to the first project, you should be
able to just use the fully qualified name in the form.

//in the second project
public static string Greetings = "Hello from Norway.";

//in the first project (which has a reference to the second project)
namespace WindowsApplication80
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

this.Text = WindowsApplication81.Form1.Greetings;
}
}
}
=================
Clay Burch
Syncfusion, Inc.

Feb 13 '07 #2
Hans - DiaGraphIT - <Ha************@discussions.microsoft.comwrote:
In one solution I have 2 projects. One project is containing the windows
form and the other conatins a public class returning a string... "Greetings
from Norway :-)"

How can I show the "greetings from Norway :-)" string in the solution with
the form...?
Add a reference from the UI project to the other project. In the form,
create an instance of the class (assuming it's an instance method that
returns the string) and then call the method.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 13 '07 #3


"Jon Skeet [C# MVP]" wrote:
Hans - DiaGraphIT - <Ha************@discussions.microsoft.comwrote:
In one solution I have 2 projects. One project is containing the windows
form and the other conatins a public class returning a string... "Greetings
from Norway :-)"

How can I show the "greetings from Norway :-)" string in the solution with
the form...?

Add a reference from the UI project to the other project. In the form,
create an instance of the class (assuming it's an instance method that
returns the string) and then call the method.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Thank you Jon!
In the project containing the form I've added a references to the "greeting"
project. It work just fine. But...

If the "greeting" changes. Do I need to re-add a reference or How do I renew
the reference?

Best regards
Hans
Feb 13 '07 #4
Hans - DiaGraphIT - <Ha************@discussions.microsoft.comwrote:
Thank you Jon!
In the project containing the form I've added a references to the "greeting"
project. It work just fine. But...

If the "greeting" changes. Do I need to re-add a reference or How do I renew
the reference?
Just rebuild and it'll pick up the changes.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 13 '07 #5


"Jon Skeet [C# MVP]" wrote:
Hans - DiaGraphIT - <Ha************@discussions.microsoft.comwrote:
Thank you Jon!
In the project containing the form I've added a references to the "greeting"
project. It work just fine. But...

If the "greeting" changes. Do I need to re-add a reference or How do I renew
the reference?

Just rebuild and it'll pick up the changes.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Thank you again :-)

/Hans
Feb 13 '07 #6

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

Similar topics

10
510
by: Simon Jefferies | last post by:
Hello, I'm getting a strange problem where when I load up my solution that has three projects:- a managed C++ .NET, one C++ lib, and a VB library. It locks up and doesn't load completely, I...
4
1594
by: Stephen Ritchie | last post by:
At the moment we have in Solution Explorer 12 projects and using the configuration manager we ahve all dependancies and build order set correctly. The problem is that when we do >Debug>Start (F5)...
2
2466
by: Mark | last post by:
Is there a realistic way for some developers on our team to work with multiple projects in a single solution under VSS source control, and have other developers only working with a single project...
0
3520
by: Eric Barr | last post by:
I saw a small number of old threads about a strange build error, but never saw a solution. I just spent about 4 hours debugging this so i hoped i could help out people who come across this...
1
2054
by: Ravi Chaudhary | last post by:
Hi, We are using VS.Net 2003 and coding in VB.net. The solution has 38 projects; most of the projects in the solution reference other projects (without any circular references) and all the...
5
349
by: Tim Marsden | last post by:
HI, I am developing a application in vb.net. I split down my functionality into several separate DLL's. The solution is becoming very large, nearly 100 projects, each project a dll's. There is...
3
1964
by: Paras Sharma | last post by:
Hi all, We are facing this big problem. Scenario is as follows. We have one single solution (say EIS) under which there are 25 projects. All the files are saved at a central location under...
3
6823
by: Danny | last post by:
Hi I trying to master msBuild but have a problem. I have a solution that I wish to build using msbuild but want to override BeforeBuild/AfterBuild targets for each of the projects. I trying to...
4
3546
by: | last post by:
I have learned about compartmentalizing my code base using Class Libraries. I have my common code such as my ORM framework broken out into their own Class Libraries, which are referenced as...
3
2144
by: Manikandan | last post by:
Hi, I'm copying projects from a solution in the vss. In my local system i created solution ,added that project(make modification related to solution) When i added this solution to vss, projects...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.