Link to home
Start Free TrialLog in
Avatar of geekboysteves
geekboysteves

asked on

Navigate between Forms in different Projects in the same Solution (Visual Studio .NET)

I understand it is a common practice to have multiple Projects on one Solution in Visual Studio .NET, and I have had some luck making things work this way.

But, I can’t figure out a way to make the usual…

Dim Frm2 as New FormInOtherProject
Frm2.Show

…to recognize the Form in the other Project.  It always has the blue squiggly underline and says FormInOtherProject is not defined.

How is this done?

I don't know if Inheritance comes into play; all forms already Inherit(s) System.Windows.Forms.Form and you only get one Inherit per Class!

Thanks!
Avatar of RonaldBiemans
RonaldBiemans

reference the other project in the project you want it, choose add references than choose the project tab and then select the project you want to use the form from.
Avatar of Bob Learned
Did you add a Project reference to Project2 from Project1?

You need to specify fully qualified names:  Namespace.Project.Form.

It would be helpful if both projects were in the same Namespace.

Bob
this is the usual config,U can use form by name if it's cofigured as shared(same level) and member of the same object
Avatar of geekboysteves

ASKER

Wnen I attempt to add a reference to Project2 (named 'OtherProjectTestFormOpoen’) in Project1 I get:

A reference to ‘OtherProjectTestFormOpoen’ could not be added. An assembly must have a ‘dll’ extension in order to be referenced.

As for NameSpaces, Visual Studio generates all the code with the word 'NameSpace' in it, and that is only in the code for DataSets (.xsd files).

Still lost...
ASKER CERTIFIED SOLUTION
Avatar of RonaldBiemans
RonaldBiemans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@RonaldBiemans:
BSM attached :)

Bob
I did not get anywhere with NameSpaces or References, but _Linking_ to the Form in Project2 worked perfectly.  I did it for a project2 I created and for a sample project I downloaded from the code-project.  The link worked for both.  As I always find after hours of head-scratching, if you're writing more than two lines of code, or scrambling in the bushes on your ninth stroke, you are not doing things the Visual Studio .NET way.

We need a Visual Studio .NET Area on the EE.

Thanks very much.

Steve