473,659 Members | 3,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access other forms in a solution

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 behind other forms in different Class Libraries?

Best Rgds
22Pom
Sep 18 '08 #1
10 1627
I am not sure what you mean by a "Background form", but the first part of
your questions is pretty easy. Go to Project Add Windows Form... and
create your "subform". Let's assume you accepted the default name of Form2.
Then back in Form1 code all you need to do is ...

Dim f2 as new Form2
f2.Show

I suspect you'll have more questions but this should get you started.

Bob

"22Pom" <22***@discussi ons.microsoft.c omwrote in message
news:93******** *************** ***********@mic rosoft.com...
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 behind other forms in different Class Libraries?

Best Rgds
22Pom

Sep 18 '08 #2
Hi eBob.com

Thanks for your reply.

What I have is one form, Background, that is basically a pictire covering
the whole screen. It is classed as a Parent form and all other forms as
Childs. The Parent form remains visible all the time and the childs open and
close as you move through the program.

Now this Background form is in one Class Library of my Solution and I need
to access this from another Class Library of my Solution.

Thanks
22Pom

"eBob.com" wrote:
I am not sure what you mean by a "Background form", but the first part of
your questions is pretty easy. Go to Project Add Windows Form... and
create your "subform". Let's assume you accepted the default name of Form2.
Then back in Form1 code all you need to do is ...

Dim f2 as new Form2
f2.Show

I suspect you'll have more questions but this should get you started.

Bob
Sep 18 '08 #3
I'm assuming you have something like Project1, which contains the class
MainForm, and Project2 which has the class ChildForm.

In your Project1, add a reference. The dialog that pops up will have a .Net
tab, a COM tab, then Projects tab. The projects tab should show Project2.
Add it as a reference. Now in Project1.MainFo rm, you can instantiate a
ChildForm as:

Dim c as New Project2.ChildF orm

The rest of your post sounds like you are talking about a Multi Document
Interface. The key steps in this would be to set your
MainForm.IsMdiC ontainer = true, and when you create the ChildForm, to set
the ChildForm.MdiPa rent to be the MainForm.
"22Pom" <22***@discussi ons.microsoft.c omwrote in message
news:93******** *************** ***********@mic rosoft.com...
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 behind other forms in different Class Libraries?

Best Rgds
22Pom
Sep 18 '08 #4
Hi Family Tree Mike,

If I could post a screen shot of my Solution it would help you understand
things better.

I have created a Multi-Project Solution that has 5 Class Libraries. In one
called StartUp I have an Exit Module with the following code:

Module ModExit

Public cancel As Integer
Public Sub ExitProc()

Dim response As Integer

response = MsgBox("End Program Now", vbYesNo + vbQuestion)
If response = vbYes Then
Application.Exi t()
ElseIf response = vbNo Then
cancel = 1
End If
End Sub

End Module

This works fine if I want to exit my program from here, but I can't seem to
access this from another anywhere else. If I create another module in
another class and copy the code over I get an error on "Applicatio n", so that
won't work.

I have various points in my program where the user can opt to exit so how to
access the original is my problem.
"Family Tree Mike" wrote:
I'm assuming you have something like Project1, which contains the class
MainForm, and Project2 which has the class ChildForm.

In your Project1, add a reference. The dialog that pops up will have a .Net
tab, a COM tab, then Projects tab. The projects tab should show Project2.
Add it as a reference. Now in Project1.MainFo rm, you can instantiate a
ChildForm as:

Dim c as New Project2.ChildF orm

The rest of your post sounds like you are talking about a Multi Document
Interface. The key steps in this would be to set your
MainForm.IsMdiC ontainer = true, and when you create the ChildForm, to set
the ChildForm.MdiPa rent to be the MainForm.
Sep 18 '08 #5
This same topic is being discussed in a thread called "Can an MDI child
close and MDI parent?".

Generally I raise an event from the child form to the calling application.
The calling application (which has your module modexit), catches the event
and closes the application.

"22Pom" <22***@discussi ons.microsoft.c omwrote in message
news:CC******** *************** ***********@mic rosoft.com...
Hi Family Tree Mike,

If I could post a screen shot of my Solution it would help you understand
things better.

I have created a Multi-Project Solution that has 5 Class Libraries. In
one
called StartUp I have an Exit Module with the following code:

Module ModExit

Public cancel As Integer
Public Sub ExitProc()

Dim response As Integer

response = MsgBox("End Program Now", vbYesNo + vbQuestion)
If response = vbYes Then
Application.Exi t()
ElseIf response = vbNo Then
cancel = 1
End If
End Sub

End Module

This works fine if I want to exit my program from here, but I can't seem
to
access this from another anywhere else. If I create another module in
another class and copy the code over I get an error on "Applicatio n", so
that
won't work.

I have various points in my program where the user can opt to exit so how
to
access the original is my problem.
"Family Tree Mike" wrote:
>I'm assuming you have something like Project1, which contains the class
MainForm, and Project2 which has the class ChildForm.

In your Project1, add a reference. The dialog that pops up will have a
.Net
tab, a COM tab, then Projects tab. The projects tab should show
Project2.
Add it as a reference. Now in Project1.MainFo rm, you can instantiate a
ChildForm as:

Dim c as New Project2.ChildF orm

The rest of your post sounds like you are talking about a Multi Document
Interface. The key steps in this would be to set your
MainForm.IsMdi Container = true, and when you create the ChildForm, to set
the ChildForm.MdiPa rent to be the MainForm.
Sep 18 '08 #6
Hi Family Tree Mike,

What I tried in the Child Form (CentrifugalSpl ash) was the following:

Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click

ExitProc()

End Sub

which is what I had used before in my very large program, and it worked just
fine. Unfortunately it gives me an error on the "ExitProc() " saying that it
is not declared. I tried many ways to overcome this without success.

Thanks
22Pom
"Family Tree Mike" wrote:
This same topic is being discussed in a thread called "Can an MDI child
close and MDI parent?".

Generally I raise an event from the child form to the calling application.
The calling application (which has your module modexit), catches the event
and closes the application.
Sep 19 '08 #7
ExitProc() must be a routine in your program (the very large program, as you
say). It is not a method that is in MSDN, that I can find. I found a few
hits as to ExitProc in Delphi.

In your large project, presumably, you should be able to highlight an
occurance of ExitProc, and right click to get the option "Go to Definition".
This should help identify what ExitProc is.

"22Pom" <22***@discussi ons.microsoft.c omwrote in message
news:60******** *************** ***********@mic rosoft.com...
Hi Family Tree Mike,

What I tried in the Child Form (CentrifugalSpl ash) was the following:

Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click

ExitProc()

End Sub

which is what I had used before in my very large program, and it worked
just
fine. Unfortunately it gives me an error on the "ExitProc() " saying that
it
is not declared. I tried many ways to overcome this without success.

Thanks
22Pom
"Family Tree Mike" wrote:
>This same topic is being discussed in a thread called "Can an MDI child
close and MDI parent?".

Generally I raise an event from the child form to the calling
application.
The calling application (which has your module modexit), catches the
event
and closes the application.
Sep 19 '08 #8
Hi Family Tree Mike,

Yes it's a Module that holds the code I put up in an earlier message, it's
getting the program to call it from another class. I'm trying another way
around this and if I find a solution I'll post it for all to use.

Rgds,
22Pom

"Family Tree Mike" wrote:
ExitProc() must be a routine in your program (the very large program, as you
say). It is not a method that is in MSDN, that I can find. I found a few
hits as to ExitProc in Delphi.

In your large project, presumably, you should be able to highlight an
occurance of ExitProc, and right click to get the option "Go to Definition".
This should help identify what ExitProc is.
Sep 19 '08 #9
OK, modules cannot be shared (to my knowledge) from DLLs. I do more in C#
than VB, but I believe that one way would be to make a shared public method
in a utility class from your dll, or a utility dll. You don't want to put
it into a class in the main application project, as that would cause a
circular reference problem.
"22Pom" <22***@discussi ons.microsoft.c omwrote in message
news:A3******** *************** ***********@mic rosoft.com...
Hi Family Tree Mike,

Yes it's a Module that holds the code I put up in an earlier message, it's
getting the program to call it from another class. I'm trying another way
around this and if I find a solution I'll post it for all to use.

Rgds,
22Pom

"Family Tree Mike" wrote:
>ExitProc() must be a routine in your program (the very large program, as
you
say). It is not a method that is in MSDN, that I can find. I found a
few
hits as to ExitProc in Delphi.

In your large project, presumably, you should be able to highlight an
occurance of ExitProc, and right click to get the option "Go to
Definition".
This should help identify what ExitProc is.
Sep 19 '08 #10

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

Similar topics

63
5894
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy in Visual Studio to create reports and labels as it's in Access?` The advantage of VS.net is that not every user needs Access, right? And that would eliminate the Access version problem as well I guess.
13
2931
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded. I believe a dotNet solution is better, but I'm trying to be as convincing as possible -- and maybe I'm wrong! I would appreciate any input or references which could help me.
13
7477
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on it, a frontend and a backend. Case 1: If vba code on the frontend updates many rows (360,000) on the backend, a form's timer event (from the frontend) will stop firing until the user gives the form focus. (Note that the update itself always...
49
14324
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The application is relatively big: around 200 tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data (SQL Server 2000), 40 users. I'm wondering what are the disadvantages of using Access as front-end? Other that it's not...
11
17042
by: Rosco | last post by:
Does anyone have a good URL or info whre Oracle and Access are compared to one another in performance, security, cost etc. Before you jump on me I know Oracle is a Cadillac compared to Access the Ford Fairlane. I need this info to complete a school project. Thanks.
20
3322
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to speed. I like books with practical exercises, and also with test questions (like cert books) *2*
2
4228
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with this. Also - the citrix folks do not want us to keep the FE in Access as the queries and other activities consume a lot of power. The users will be in 3 different offices across the globe all accessing the 1 Oracle DB in Citrix. Does anyone have...
22
6255
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one client (MS Access vs ..NET Windows Forms) would be preferred over the other. While I have some good arguments on both sides, I would appreciate your points of view on the topic.
9
2092
by: Bob Alston | last post by:
I am looking for electronic forms software that would integrate well with MS Access. I have a client for whom I built a client database to replace and update one they had that was obsolete and not doing what they want. They are wanting to move on to the next step and automate most of their forms. some are boilerplate forms that are simple printed without change. some are boilerplate but require signatures from client and rep. Others...
6
6255
by: onnodb | last post by:
Hi all, While working on an Access UI to a MySQL database (which should be a reasonable, low-cost, flexible interface to the DB, better than web-based, much less costly than a full-fledged .NET app or so.... is it?), I tried measuring the bandwith consumed by the Access/MyODBC/MySQL link, which came out to be, er, quite high. I fancied it would be interesting to look at the queries Access throws at MySQL through the ODBC link, so I...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.