MDI Forms in modal (dialog mode)
Ok, I have some forms that are children of my primary form. The thing is, I want to display them as a dialog (modal) so that the primary form can't be edited until the currently active child form is closed.
Now, I want to keep the MDI forms as MDI forms but also be able to display them in modal mode.
Unfortunately it seems like VB.net errors when I try to .ShowDialog(me) instead of the regular .Show()
Code:
VB Code:
Dim frmGen As New frm_Generator
frmGen.MdiParent = Me
frmGen.ShowDialog(Me)
Any ideas?
Luc L.
Re: MDI Forms in modal (dialog mode)
I haven't done that exact scenario, but when I do ShowDialog, I don't pass any parameters to it.
frmGen.ShowDialog()
Re: MDI Forms in modal (dialog mode)
A dialog is a dialog and an MDI child is an MDI child. A child form is contained within the parent, so you can't disable the parent without disabling the child too. The whole idea of using MDI is the M, i.e. multiple. If you aren't using multiple forms then there is no real point using MDI. If you don't want the user to be able to access the controls on the parent form while a particular MDI child is open then you would need to disable those controls specifically but, as i said, that goes against the standard Windows interface design, so I wouldn't recommend it.