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

Open Another form and close itself

I did a web search and found someone is looking for what I'm looking for:

There are 2 forms...named => formA and formB
and each of them have their own button named => btnA and btnB

The application starts with formA

can you show me the code that... when I click on btnA in formA, It will
CLOSE formA and open formB...

Then when I click btnB from formB, it will close formB and open back formA

How can I do this? I dun want their visible set to .false
I want them really close and use no resources from my computer.. How?
Thanks for your help....

http://www.experts-exchange.com/Prog..._21185658.html
Nov 23 '05 #1
10 7029
Thanks, But I couldn't find a solution in that article.
it is about communication between froms, I don't know how to
close a form through another form. (or show a new form, then close old form)

"ucasesoftware" <uc***********@hotmail.fr> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
the best way is this :

http://msdn.microsoft.com/library/de...adingToNET.asp

Nov 23 '05 #3
If formb is instantiated within forma, then you cannot close forma without
destroying formb.

What you can do is to use the code in the button in forms a and b to return
a dialog result to the calling code so we could have a loop in the sub Start
which is an optional startup point and use the return value from the from to
decide what action to take next.

--
Best Regards

The Inimitable Mr Newbie º¿º
"Saber" <saber[.AT.]oxin.ir> wrote in message
news:OT**************@tk2msftngp13.phx.gbl...
I did a web search and found someone is looking for what I'm looking for:

There are 2 forms...named => formA and formB
and each of them have their own button named => btnA and btnB

The application starts with formA

can you show me the code that... when I click on btnA in formA, It will
CLOSE formA and open formB...

Then when I click btnB from formB, it will close formB and open back formA

How can I do this? I dun want their visible set to .false
I want them really close and use no resources from my computer.. How?
Thanks for your help....

http://www.experts-exchange.com/Prog..._21185658.html

Nov 23 '05 #4
"Saber" <saber[.AT.]oxin.ir> schrieb:
There are 2 forms...named => formA and formB
and each of them have their own button named => btnA and btnB

The application starts with formA

can you show me the code that... when I click on btnA in formA, It will
CLOSE formA and open formB...

Then when I click btnB from formB, it will close formB and open back formA


See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/1f74a1bd0a1f457b>

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

Nov 23 '05 #5
Thanks Herfireid,
Sorry for this stupid question, but how can I use your code?
I created 2 classes and 1 module and pasted your code.
but what then...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uh**************@TK2MSFTNGP14.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb:
There are 2 forms...named => formA and formB
and each of them have their own button named => btnA and btnB

The application starts with formA

can you show me the code that... when I click on btnA in formA, It will
CLOSE formA and open formB...

Then when I click btnB from formB, it will close formB and open back
formA


See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/1f74a1bd0a1f457b>

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

Nov 23 '05 #6
i'm sorry but my solutions could do that

you can access to formA in formB with

formA.close

Nov 23 '05 #7
sorry

1.can you show me the code that... when I click on btnA in formA, It
will
CLOSE formA and open formB...
and BECAUSE you have the class (of msnd sample)
you could run an procedure in formB

'Create form B
Dim frm as new formB
frm.show()
'Call a procedure in formB to close FormA (with the class msdn)
classForm.formB.CloseFormA

Don't forget that your have in
formB_Load
classForm.formB = me

and in formB_Closed
classForm.formB = nothing

Nov 23 '05 #8
You dont seem to be reading or understanding what people are saying to you
here. In .NET Everything is an object.

This means you need to instantiate them somwhere, and where would this be,
'An object' A form is an class which has been instantiated so if we have
two objects and each instantiates the other within itself, then one cannot
destroy the other without destroying itself.

You have been given several approaches to resolving this conundrum, what
specifically do you want from the folks here over and above what has already
been given. ?
--
Best Regards

The Inimitable Mr Newbie º¿º

"Saber" <saber[.AT.]oxin.ir> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
Thanks Herfireid,
Sorry for this stupid question, but how can I use your code?
I created 2 classes and 1 module and pasted your code.
but what then...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uh**************@TK2MSFTNGP14.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb:
There are 2 forms...named => formA and formB
and each of them have their own button named => btnA and btnB

The application starts with formA

can you show me the code that... when I click on btnA in formA, It will
CLOSE formA and open formB...

Then when I click btnB from formB, it will close formB and open back
formA


See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/1f74a1bd0a1f457b>

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


Nov 23 '05 #9
Thanks for your guides Mr Newbie,
Herfried gave me a code and I asked him how to use it.
I read your previous post and satisfied, but I've to find
an alternative.

There are 12 forms in my program, on each of them there
are 11 links to other forms.
what's your solution to show just one form while the program is running?

"Mr Newbie" <he**@now.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
You dont seem to be reading or understanding what people are saying to you
here. In .NET Everything is an object.

This means you need to instantiate them somwhere, and where would this be,
'An object' A form is an class which has been instantiated so if we have
two objects and each instantiates the other within itself, then one cannot
destroy the other without destroying itself.

You have been given several approaches to resolving this conundrum, what
specifically do you want from the folks here over and above what has
already been given. ?
--
Best Regards

The Inimitable Mr Newbie º¿º

"Saber" <saber[.AT.]oxin.ir> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
Thanks Herfireid,
Sorry for this stupid question, but how can I use your code?
I created 2 classes and 1 module and pasted your code.
but what then...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uh**************@TK2MSFTNGP14.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb:
There are 2 forms...named => formA and formB
and each of them have their own button named => btnA and btnB

The application starts with formA

can you show me the code that... when I click on btnA in formA, It will
CLOSE formA and open formB...

Then when I click btnB from formB, it will close formB and open back
formA

See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/1f74a1bd0a1f457b>

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



Nov 23 '05 #10
read my previous post.
--
Best Regards

The Inimitable Mr Newbie º¿º
"Saber" <saber[.AT.]oxin.ir> wrote in message
news:OS**************@TK2MSFTNGP14.phx.gbl...
Thanks for your guides Mr Newbie,
Herfried gave me a code and I asked him how to use it.
I read your previous post and satisfied, but I've to find
an alternative.

There are 12 forms in my program, on each of them there
are 11 links to other forms.
what's your solution to show just one form while the program is running?

"Mr Newbie" <he**@now.com> wrote in message
news:uJ**************@TK2MSFTNGP12.phx.gbl...
You dont seem to be reading or understanding what people are saying to
you here. In .NET Everything is an object.

This means you need to instantiate them somwhere, and where would this
be, 'An object' A form is an class which has been instantiated so if we
have two objects and each instantiates the other within itself, then one
cannot destroy the other without destroying itself.

You have been given several approaches to resolving this conundrum, what
specifically do you want from the folks here over and above what has
already been given. ?
--
Best Regards

The Inimitable Mr Newbie º¿º

"Saber" <saber[.AT.]oxin.ir> wrote in message
news:e4**************@TK2MSFTNGP10.phx.gbl...
Thanks Herfireid,
Sorry for this stupid question, but how can I use your code?
I created 2 classes and 1 module and pasted your code.
but what then...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uh**************@TK2MSFTNGP14.phx.gbl...
"Saber" <saber[.AT.]oxin.ir> schrieb:
> There are 2 forms...named => formA and formB
> and each of them have their own button named => btnA and btnB
>
> The application starts with formA
>
> can you show me the code that... when I click on btnA in formA, It
> will CLOSE formA and open formB...
>
> Then when I click btnB from formB, it will close formB and open back
> formA

See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/1f74a1bd0a1f457b>

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



Nov 23 '05 #11

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

Similar topics

55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
13
by: Seth Spearman | last post by:
Hey guys, I have the following code: '****************************************************** If Not Me.NewRecord Then Dim rs As DAO.Recordset Dim strBookmark As String Set rs =...
15
by: Dave | last post by:
Has anyone encountered the error message "Can not open any more databases" and what did you do to solve it? Thanks, Dave
4
by: DraguVaso | last post by:
Hi, I want a Login-form that, once the username and password are validated, opens a new Form (of the 'main'-application), and closes itself. I tryed it like this: putting the following code in...
10
by: Alex | last post by:
For example, I create Login form first. When user login, it open the main form and close the login form itself.
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
25
by: Andy_Khosravi | last post by:
I just recently changed my database that I'm running from a monolithic DB to a split FE/BE. The front end resides on the client machine and the BE resides on a network drive. I'm experimenting with...
7
by: martin DH | last post by:
Hello, I have a report that I open that pull its data from a form that builds a where string. Opening the report first opens the form, where I enter criteria, and then pulls matching records from a...
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
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.