PC Review


Reply
Thread Tools Rate Thread

Displaying a form as top, and modal, but without ShowDialog

 
 
Paul Aspinall
Guest
Posts: n/a
 
      11th Feb 2005
Can anyone advise how to display a form on top, and modal, without using
ShowDialog??

Thanks


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      11th Feb 2005
Paul,

Why do you not want to use ShowDialog? If the form is modal, then I
don't see what the difference is.

What are you trying to do?


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Paul Aspinall" <(E-Mail Removed)> wrote in message
news:i_3Pd.62386$(E-Mail Removed)...
> Can anyone advise how to display a form on top, and modal, without using
> ShowDialog??
>
> Thanks
>
>



 
Reply With Quote
 
Paul Aspinall
Guest
Posts: n/a
 
      11th Feb 2005
Hi

The reason is...
I have the user entering into a form, which must be modal (which I was using
ShowDialog to display), simila to a 'Wizard' style.

However, when the user makes an invalid entry, I want to display a
MessageBox, to inform them of a certain condtion....

this results in another modal form, being shown from a modal form......

When the user clicks 'OK' on the message, both 'modal' forms disappear, ie.
the message, and the 'wizard'.

Any ideas how to stop this?

Thanks


"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Paul,
>
> Why do you not want to use ShowDialog? If the form is modal, then I
> don't see what the difference is.
>
> What are you trying to do?
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Paul Aspinall" <(E-Mail Removed)> wrote in message
> news:i_3Pd.62386$(E-Mail Removed)...
>> Can anyone advise how to display a form on top, and modal, without using
>> ShowDialog??
>>
>> Thanks
>>
>>

>
>



 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      11th Feb 2005
Paul,

Can you show a piece of code that does this? I've whipped up a small
example, and tried to show a modal form, then a messagebox, and regardless
of whether or not I set the parent of the modal form or the dialog box, that
is not the behavior I get.

I think that there is something else going on.

If you could show an example, it would be helpful.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Paul Aspinall" <(E-Mail Removed)> wrote in message
newsv4Pd.43822$(E-Mail Removed)...
> Hi
>
> The reason is...
> I have the user entering into a form, which must be modal (which I was
> using ShowDialog to display), simila to a 'Wizard' style.
>
> However, when the user makes an invalid entry, I want to display a
> MessageBox, to inform them of a certain condtion....
>
> this results in another modal form, being shown from a modal form......
>
> When the user clicks 'OK' on the message, both 'modal' forms disappear,
> ie. the message, and the 'wizard'.
>
> Any ideas how to stop this?
>
> Thanks
>
>
> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
> in message news:(E-Mail Removed)...
>> Paul,
>>
>> Why do you not want to use ShowDialog? If the form is modal, then I
>> don't see what the difference is.
>>
>> What are you trying to do?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - (E-Mail Removed)
>>
>> "Paul Aspinall" <(E-Mail Removed)> wrote in message
>> news:i_3Pd.62386$(E-Mail Removed)...
>>> Can anyone advise how to display a form on top, and modal, without using
>>> ShowDialog??
>>>
>>> Thanks
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      11th Feb 2005
Paul,

I've recreated the example as an MDI app, which has one child form, and
then shows a modal dialog, and then shows a messagebox, and I don't get the
result that you do. I should note that I am running on .NET 2.0, so the
problem could have been fixed.

However, I would ask the following:

- When creating the MDI child form, are you setting the MdiParent property
to the MDI parent form (I assume yes on this one).
- When showing the modal dialog, are you passing the MDI child form as the
owner parameter in the call to ShowDialog?
- When calling the static Show method on the MessageBox, are you passing the
modal dialog as the owner parameter?

I have done all of the above, and could not reproduce the error.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Paul Aspinall" <(E-Mail Removed)> wrote in message
newsv4Pd.43822$(E-Mail Removed)...
> Hi
>
> The reason is...
> I have the user entering into a form, which must be modal (which I was
> using ShowDialog to display), simila to a 'Wizard' style.
>
> However, when the user makes an invalid entry, I want to display a
> MessageBox, to inform them of a certain condtion....
>
> this results in another modal form, being shown from a modal form......
>
> When the user clicks 'OK' on the message, both 'modal' forms disappear,
> ie. the message, and the 'wizard'.
>
> Any ideas how to stop this?
>
> Thanks
>
>
> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
> in message news:(E-Mail Removed)...
>> Paul,
>>
>> Why do you not want to use ShowDialog? If the form is modal, then I
>> don't see what the difference is.
>>
>> What are you trying to do?
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - (E-Mail Removed)
>>
>> "Paul Aspinall" <(E-Mail Removed)> wrote in message
>> news:i_3Pd.62386$(E-Mail Removed)...
>>> Can anyone advise how to display a form on top, and modal, without using
>>> ShowDialog??
>>>
>>> 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form that is already displayed modally cannot be displayed as a modal dialog box. Close the form before calling showDialog. Jared Microsoft Dot NET Framework Forms 4 28th Sep 2006 09:49 AM
Application.Run and ShowDialog (modal dialog on top of main form) Bob Microsoft Dot NET Framework Forms 2 30th Nov 2005 11:57 PM
Use modal form in a panel, or how to create a 'ShowDialog' like solution Rene Microsoft C# .NET 0 18th Sep 2005 12:06 PM
using form.showdialog to control modal window TS Microsoft Dot NET Framework Forms 2 17th Jan 2005 01:01 PM
Why when I open this form using ShowDialog() it becomes modal.. =?Utf-8?B?TXJOb2JvZHk=?= Microsoft C# .NET 5 11th Jan 2005 02:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:25 AM.