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

Reply

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

 
Thread Tools Rate Thread
Old 14-03-2007, 01:05 PM   #1
=?Utf-8?B?S2VycnkgTW9vcm1hbg==?=
Guest
 
Posts: n/a
Default RE: Form that is not a top-level form cannot be displayed as a modal d


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
>
>
>
>
>
>
>
>
>
>
>
>
>

  Reply With Quote
Old 14-03-2007, 01:55 PM   #2
Chris Dunaway
Guest
 
Posts: n/a
Default Re: Form that is not a top-level form cannot be displayed as a modal d

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

  Reply With Quote
Old 14-03-2007, 01:56 PM   #3
active
Guest
 
Posts: n/a
Default Form that is not a top-level form cannot be displayed as a modal dialog box error

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












  Reply With Quote
Old 14-03-2007, 02:10 PM   #4
active
Guest
 
Posts: n/a
Default Re: Form that is not a top-level form cannot be displayed as a modal d


"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
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>



  Reply With Quote
Old 14-03-2007, 03:47 PM   #5
active
Guest
 
Posts: n/a
Default Re: Form that is not a top-level form cannot be displayed as a modal d


"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


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off