473,320 Members | 1,817 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,320 software developers and data experts.

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 1601
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***@discussions.microsoft.comwrote in message
news:93**********************************@microsof t.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.MainForm, you can instantiate a
ChildForm as:

Dim c as New Project2.ChildForm

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.IsMdiContainer = true, and when you create the ChildForm, to set
the ChildForm.MdiParent to be the MainForm.
"22Pom" <22***@discussions.microsoft.comwrote in message
news:93**********************************@microsof t.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.Exit()
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 "Application", 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.MainForm, you can instantiate a
ChildForm as:

Dim c as New Project2.ChildForm

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.IsMdiContainer = true, and when you create the ChildForm, to set
the ChildForm.MdiParent 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***@discussions.microsoft.comwrote in message
news:CC**********************************@microsof t.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.Exit()
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 "Application", 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.MainForm, you can instantiate a
ChildForm as:

Dim c as New Project2.ChildForm

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.IsMdiContainer = true, and when you create the ChildForm, to set
the ChildForm.MdiParent to be the MainForm.
Sep 18 '08 #6
Hi Family Tree Mike,

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

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) 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***@discussions.microsoft.comwrote in message
news:60**********************************@microsof t.com...
Hi Family Tree Mike,

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

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) 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***@discussions.microsoft.comwrote in message
news:A3**********************************@microsof t.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
Hi Family Tree Mike,

I don't know. I think I'll give up on this, I can't seem to work it out.
I've tried all things that I can think of without success. If I move it to
another area I get a different error. If I try to access it using it's full
address path I get other errors, so I think I'l go back to adding a lot of
duplicated code and hope for the best.

Thanks anyway for your input.

Best Rgds,
22Pom

"Family Tree Mike" wrote:
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.

Sep 19 '08 #11

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

Similar topics

63
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...
13
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....
13
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...
49
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...
11
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...
20
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...
2
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...
22
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...
9
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...
6
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.