?
Solved

VB.NET Access sub or function between projects in a solution

Posted on 2011-03-14
3
Medium Priority
?
307 Views
Last Modified: 2012-05-11
I have a VB.NET 2008 solution that has multiple projects in it.  I need to be able to call a sub that resides in Project A from Project B.  I also need to be able to pass a string to that sub in Project A when I call it from Project B.

Is this possible?  Hopefully it makes sense.  Thanks for the suggestions.
0
Comment
Question by:JasonJasonJasonJason
  • 2
3 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35134757
What types of projects are these ?
Usually you would just add a reference to project B from Project A.
Then you would call the sub in thee same way as function but adding the project name and possibly class name infrom of the function/subname i.e.

projectb.classa.suba()

you can obviously pass parameters into this function call in the same way as for a normal function call.
0
 

Author Comment

by:JasonJasonJasonJason
ID: 35134834
i added the reference to the project a from project b.  

In project B when i type projecta.form1. it does not list the subs.

do you know why it would do this?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 total points
ID: 35134934
Have a look at this article it should help : http://visualbasic.about.com/od/usingvbnet/l/aa080703a.htm
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question