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

MdiChild Forms in VB.Net

P: n/a
Working with VB.Net I'm using a MdiParent form, bringing a child form as
follows:

Dim frmMaintenance As New frmMaintenance

frmMaintenance.MdiParent = Me

' Display the child form.

frmMaintenance.Show()

Now the frmMaintenance shows up just fine but I'd like to close it and
return to the frmMain (the MdiParent). The code I'm doing it with is:

frmMaintenance.ActiveForm.Close()

That line I'm 99% sure is not proper. When my Close event is fired it runs
that line and the whole application closes. I have serveral references I've
looked at and none of them

reveal how to close the MdiChild, frmMaintenance, in the case and return to
my MdiParent, frmMain.

Anyone have some advice?

Thanks

Phil


Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
* "Deep Phee" <pt***@yahoo.com> scripsit:
Working with VB.Net I'm using a MdiParent form, bringing a child form as
follows:

Dim frmMaintenance As New frmMaintenance

frmMaintenance.MdiParent = Me

' Display the child form.

frmMaintenance.Show()

Now the frmMaintenance shows up just fine but I'd like to close it and
return to the frmMain (the MdiParent). The code I'm doing it with is:

frmMaintenance.ActiveForm.Close()

That line I'm 99% sure is not proper. When my Close event is fired it runs
that line and the whole application closes. I have serveral references I've
looked at and none of them

reveal how to close the MdiChild, frmMaintenance, in the case and return to
my MdiParent, frmMain.


In the child form:

\\\
Me.Close()
///

- or -

In the MDI container form:

\\\
Me.ActiveMdiChild.Close()
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.