Easy - VS Project Ref. Quest

G

Guest

How do I reference a WinForm file (i.e. Class) in Project B from a WinForm
file in Project A?

I've previously used
Tutorial: Creating C# Class Library (DLL) Using Visual Studio .NET
http://www.c-sharpcorner.com/2/pr12.asp
to create a dll reference for Project A but how do you reference a form in
one project to another form in another project?

**************

using Project B

Project_A_ CTR()
{
Form1 form1= new Form1(); //Project B Class
}

Projects A and B appear in the respective Add Reference -- Projects window
 
P

Peter Rilling

You cannot because both are applications (.EXE) and VS.NET does not
supporting the reference of executables. You will need to place the forms
in a library which can then be referenced by applications.
 
G

Guest

Thank You Peter - can you explain a llittle more

I have simple ADONet forms for various simple and relational dB's. Each
ADONet form actuates other Add, Delete Forms fo the dB and then one top level
form which has buttons for all the ADONet forms . If I put them all in one
project there is a mess of many disorganized files (datasets, etc)

So if I understand what your saying do I somhow make dll's out of the ADONet
forms and then reference the dll in that top level application??

Steve
 
P

Peter Rilling

You can organize it however you want. But if you have common components,
then maybe just create one project that has them all (which would be a DLL),
then you can reference them anywhere. You can create a separate VS.NET
project for each form if that is the best organization.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top