473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Can forms in different projects reference one another?

Me again. Is it possible to have two projects in a solution (ProjA and
ProjB) and have Form1 in ProjA do a .Show() for Form2 in ProjB? I tried
the following, but I get a problem with the reference

Sub ShowFormB
Dim frm as new < ? FormB?? various things I tried here>
frm.Show()
Me.Close()
End Sub

Thanks

Sep 25 '06 #1
7 2291
MikeB,

ProjA must have a reference to ProjB. In the Solution Explorer window,
right-click ProjA and select Add Reference. From the Add Reference dialog,
click the Projects tab and select ProjB.

Now your ProjA can show a form in ProjB:

Dim frm As New ProjB.SomeForm
frm.Show()

Kerry Moorman

"MikeB" wrote:
Me again. Is it possible to have two projects in a solution (ProjA and
ProjB) and have Form1 in ProjA do a .Show() for Form2 in ProjB? I tried
the following, but I get a problem with the reference

Sub ShowFormB
Dim frm as new < ? FormB?? various things I tried here>
frm.Show()
Me.Close()
End Sub

Thanks

Sep 25 '06 #2

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:33**********************************@microsof t.com...
MikeB,

ProjA must have a reference to ProjB. In the Solution Explorer window,
right-click ProjA and select Add Reference. From the Add Reference dialog,
click the Projects tab and select ProjB.

Now your ProjA can show a form in ProjB:

Dim frm As New ProjB.SomeForm
frm.Show()

Kerry Moorman

"MikeB" wrote:
>Me again. Is it possible to have two projects in a solution (ProjA and
ProjB) and have Form1 in ProjA do a .Show() for Form2 in ProjB? I tried
the following, but I get a problem with the reference

Sub ShowFormB
Dim frm as new < ? FormB?? various things I tried here>
frm.Show()
Me.Close()
End Sub

Thanks

This is kinda tricky. What I would prefer in my own projects would be to
create a separate library project for the shared forms. This project would
then be referenced by the two winforms projects. This prevents circular
references from occurring.

HTH,
Mythran
Sep 25 '06 #3
Kerry, thank you.

Does this mean that the Projects have to have names consisting of one
word only? Is there a way to (for instance) use "Host Country" and
"Travel Information" as project names?

MikeB

Kerry Moorman wrote:
MikeB,

ProjA must have a reference to ProjB. In the Solution Explorer window,
right-click ProjA and select Add Reference. From the Add Reference dialog,
click the Projects tab and select ProjB.

Now your ProjA can show a form in ProjB:

Dim frm As New ProjB.SomeForm
frm.Show()

Kerry Moorman

"MikeB" wrote:
Me again. Is it possible to have two projects in a solution (ProjA and
ProjB) and have Form1 in ProjA do a .Show() for Form2 in ProjB? I tried
the following, but I get a problem with the reference

Sub ShowFormB
Dim frm as new < ? FormB?? various things I tried here>
frm.Show()
Me.Close()
End Sub

Thanks
Sep 25 '06 #4
MikeB,

You can have mutliple word project names, such as "Host Country". But I
think that the space gets replaced by an underscore by .Net, like this:

Dim frm As New Host_Country.SomeForm

Kerry Moorman
"MikeB" wrote:
Kerry, thank you.

Does this mean that the Projects have to have names consisting of one
word only? Is there a way to (for instance) use "Host Country" and
"Travel Information" as project names?

MikeB

Kerry Moorman wrote:
MikeB,

ProjA must have a reference to ProjB. In the Solution Explorer window,
right-click ProjA and select Add Reference. From the Add Reference dialog,
click the Projects tab and select ProjB.

Now your ProjA can show a form in ProjB:

Dim frm As New ProjB.SomeForm
frm.Show()

Kerry Moorman

"MikeB" wrote:
Me again. Is it possible to have two projects in a solution (ProjA and
ProjB) and have Form1 in ProjA do a .Show() for Form2 in ProjB? I tried
the following, but I get a problem with the reference
>
Sub ShowFormB
Dim frm as new < ? FormB?? various things I tried here>
frm.Show()
Me.Close()
End Sub
>
Thanks
>
>

Sep 25 '06 #5
"Kerry Moorman" <Ke**********@discussions.microsoft.comschrieb:
You can have mutliple word project names, such as "Host Country". But I
think that the space gets replaced by an underscore by .Net, like this:

Dim frm As New Host_Country.SomeForm
In this case I'd set a more appropriate root namespace in the project
properties.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Sep 25 '06 #6
That's all well and good but when you are writing and debugging code, it's a
pain to load the library class and change it's code...also hard to find some
errors. That's the beauty of putting all your related projects into one
solution at least until you've finished debugging them.
--
Dennis in Houston
"Mythran" wrote:
>
"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:33**********************************@microsof t.com...
MikeB,

ProjA must have a reference to ProjB. In the Solution Explorer window,
right-click ProjA and select Add Reference. From the Add Reference dialog,
click the Projects tab and select ProjB.

Now your ProjA can show a form in ProjB:

Dim frm As New ProjB.SomeForm
frm.Show()

Kerry Moorman

"MikeB" wrote:
Me again. Is it possible to have two projects in a solution (ProjA and
ProjB) and have Form1 in ProjA do a .Show() for Form2 in ProjB? I tried
the following, but I get a problem with the reference

Sub ShowFormB
Dim frm as new < ? FormB?? various things I tried here>
frm.Show()
Me.Close()
End Sub

Thanks


This is kinda tricky. What I would prefer in my own projects would be to
create a separate library project for the shared forms. This project would
then be referenced by the two winforms projects. This prevents circular
references from occurring.

HTH,
Mythran
Sep 26 '06 #7

"Dennis" <De****@discussions.microsoft.comwrote in message
news:23**********************************@microsof t.com...
That's all well and good but when you are writing and debugging code, it's
a
pain to load the library class and change it's code...also hard to find
some
errors. That's the beauty of putting all your related projects into one
solution at least until you've finished debugging them.
--
Dennis in Houston
"Mythran" wrote:
>>
"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:33**********************************@microso ft.com...
Yeah, you would put these shared forms into a project that is part of the
same solution and reference this project as a project reference from the two
winforms projects.

Mythran
Sep 26 '06 #8

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

Similar topics

0
by: Jakub G | last post by:
Hi, I’m creating a project which uses Satellite Assemblies (SA) to isolate localized resources. The solution contains eight library projects, one GUI control project and one Windows Form...
14
by: RL Stevenson | last post by:
What is a reasonable way to manage a complex form with 5 or so tabs with 100 or more controls bound to 5-10 tables in a database? Pasting all those controls, datasets, data adapters directly onto...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
0
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
27
by: Marc Reinig | last post by:
I have a program written in Visual Studio 2003 Visual Basic. I would like to move it to Visual C++. Is there an automated or relatively automated way of doing that, or do I need to recreate all...
17
by: romixnews | last post by:
Hi, I'm facing the problem of analyzing a memory allocation dynamic and object creation dynamics of a very big C++ application with a goal of optimizing its performance and eventually also...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
4
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i have a main thread an another worker thread. The main Thread creates another thread and waits for the threads signal to continue the main thread. Everything works inside a ModalDialog and...
10
by: =?Utf-8?B?MjJQb20=?= | last post by:
Hi All, Thanks to Family Tree Mike I've managed to get a Solution up and running, now comes the fun part. How do I call forms from other Class Libraries and how do I use a Background form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.