Form that is not a top-level form cannot be displayed as a modal dialog box error

G

Guest

active,

MDI Child forms cannot be shown modally. If you need to use ShowDialog with
a form, you must make sure the form is not an MDI Child form.

Kerry Moorman
 
C

Chris Dunaway

The control that is doing the creation (the New) is on a form that is a Mdi
child. The created form is not a child.

thanks

Try setting the form's TopLevel property to True before you show it.

Chris
 
A

active

At the statement:

FormEdit.ShowDialog()

I get the following:


Form that is not a top-level form cannot be displayed as a modal dialog box.
Remove the form from any parent form before calling showDialog.

For lack of a good plan I tried:
FormEdit.Parent = Nothing

FormEdit.ShowDialog()



But that did not fix it.

The control that is doing the creation (the New) is on a form that is a Mdi
child.



Got any idea at all as to what I could do?

The only reason to ShowDialog is to insure the user does not use other forms
that are open.



thanks in advance
 
A

active

Kerry Moorman said:
active,

MDI Child forms cannot be shown modally. If you need to use ShowDialog
with
a form, you must make sure the form is not an MDI Child form.

The control that is doing the creation (the New) is on a form that is a Mdi
child. The created form is not a child.


thanks
 
A

active

Chris Dunaway said:
Try setting the form's TopLevel property to True before you show it.

Chris


You did it again, that did it
I had to leave
FormEdit.Parent = Nothing
or it wouldn't let me set TopLevel

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top