By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,458 Members | 1,463 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,458 IT Pros & Developers. It's quick & easy.

Easy - VS Project Ref. Quest

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
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

Nov 16 '05 #2

P: n/a

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

"Peter Rilling" wrote:
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.

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
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


Nov 16 '05 #3

P: n/a
can I reference a "real" dll from a Adonet type form dll ?

"Peter Rilling" wrote:
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.

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
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


Nov 16 '05 #4

P: n/a
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.

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...

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

"Peter Rilling" wrote:
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.

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
> 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
>
>


Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.