PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Form that is not a top-level form cannot be displayed as a modal dialog box error
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Form that is not a top-level form cannot be displayed as a modal dialog box error
![]() |
Form that is not a top-level form cannot be displayed as a modal dialog box error |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 "active" wrote: > 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 > > > > > > > > > > > > > |
|
|
|
#2 |
|
Guest
Posts: n/a
|
On Mar 14, 9:10 am, " active" <activeNOS...@a-znet.com> wrote:
> "Kerry Moorman" <KerryMoor...@discussions.microsoft.com> wrote in message > > news:6EF76A54-2DB0-4A02-BD5D-7F50F23FB606@microsoft.com... > > > 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 > > > > > Kerry Moorman > > > "active" wrote: > > >> 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 Try setting the form's TopLevel property to True before you show it. Chris |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#4 |
|
Guest
Posts: n/a
|
"Kerry Moorman" <KerryMoorman@discussions.microsoft.com> wrote in message news:6EF76A54-2DB0-4A02-BD5D-7F50F23FB606@microsoft.com... > 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 > > Kerry Moorman > > > "active" wrote: > >> 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 >> >> >> >> >> >> >> >> >> >> >> >> >> |
|
|
|
#5 |
|
Guest
Posts: n/a
|
"Chris Dunaway" <dunawayc@gmail.com> wrote in message news:1173880500.424083.165830@l77g2000hsb.googlegroups.com... > On Mar 14, 9:10 am, " active" <activeNOS...@a-znet.com> wrote: >> "Kerry Moorman" <KerryMoor...@discussions.microsoft.com> wrote in message >> >> news:6EF76A54-2DB0-4A02-BD5D-7F50F23FB606@microsoft.com... >> >> > 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 >> >> >> >> > Kerry Moorman >> >> > "active" wrote: >> >> >> 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 > > 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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

