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

how to open another form and close the parent form in vb.net 2005

P: n/a
hi folks,

I am curently working in vb.net 2005. I am stuck at one technical
glitch. How to open another form and close the parent foem in vb.net.

I have tried every thing like me.close as well as i have tried using
dispose method also.

any help is appreciated.
Thank You.

Oct 11 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Oct 11, 4:53 am, sajit <nayar.sa...@gmail.comwrote:
hi folks,

I am curently working in vb.net 2005. I am stuck at one technical
glitch. How to open another form and close the parent foem in vb.net.

I have tried every thing like me.close as well as i have tried using
dispose method also.

any help is appreciated.
Thank You.
As in parent form, do you mean the calling form (Me)?

As in:

////////////
Dim form As New Form1()
form.Show()

Me.Close()
///////////

Thanks,

Seth Rowe

Oct 11 '07 #2

P: n/a
Sajit,

Your question depends totaly how you start your forms (about 12
posibilities).

However as you write it, it is impossible to close a calling object from a
detail object, what is happening in your situation.

Normally a called object will be garbaged when it goes out of scope.

If it is that you want to make your form invisible, then do that, that can
in different nice ways. You can even make it transparant from the first
version of dotnet on every Windows (NT based) OS by using the form opacity
property.

Cor
Oct 11 '07 #3

P: n/a
Cor Ligthert [MVP] wrote:
Sajit,

Your question depends totaly how you start your forms (about 12
posibilities).

However as you write it, it is impossible to close a calling object from a
detail object, what is happening in your situation.

Normally a called object will be garbaged when it goes out of scope.

If it is that you want to make your form invisible, then do that, that can
in different nice ways. You can even make it transparant from the first
version of dotnet on every Windows (NT based) OS by using the form opacity
property.

Cor

Could he not define the form in an invisible 1st form, as a public
shared variable?
That way if Form2 calls Form3, Form2 can be closed because Form1
actually has the object?

Miro
Oct 15 '07 #4

P: n/a
Miro,

He can do it in much more ways, however there is an inbuild Application run
in a form as you don't declare it seperatly. Therefore it is exactly as you
write.

Have a look at the answer from Armin, I don't know what it is now, but in
past he was as far as I remember me alway using the application run in a
seperated module.

Like others who are interested in this problem, have a look at that nice
answer from Armin some days ago.

http://groups.google.com/group/micro...852687402957c2

Cor
Oct 16 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.