473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Can anyone advise how to display a form on top, and modal, without using
ShowDialog??

Thanks
Nov 16 '05 #1
4 9973
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]
- mv*@spam.guard.caspershouse.com

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:i_******************@fe3.news.blueyonder.co.u k...
Can anyone advise how to display a form on top, and modal, without using
ShowDialog??

Thanks

Nov 16 '05 #2
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]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ea**************@TK2MSFTNGP12.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:i_******************@fe3.news.blueyonder.co.u k...
Can anyone advise how to display a form on top, and modal, without using
ShowDialog??

Thanks


Nov 16 '05 #3
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]
- mv*@spam.guard.caspershouse.com

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:ov******************@fe1.news.blueyonder.co.u k...
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]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ea**************@TK2MSFTNGP12.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:i_******************@fe3.news.blueyonder.co.u k...
Can anyone advise how to display a form on top, and modal, without using
ShowDialog??

Thanks



Nov 16 '05 #4
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]
- mv*@spam.guard.caspershouse.com

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:ov******************@fe1.news.blueyonder.co.u k...
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]" <mv*@spam.guard.caspershouse.com> wrote
in message news:ea**************@TK2MSFTNGP12.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:i_******************@fe3.news.blueyonder.co.u k...
Can anyone advise how to display a form on top, and modal, without using
ShowDialog??

Thanks



Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: JW | last post by:
Dear NG, Still working on my .NET CF C# forms application ... I have an array of forms that I wish to display in array order, and thus have created a loop to run through them. Due to...
4
by: C M Shaw | last post by:
I have a form which I want to show modally; it's a fairly old form that's been ported up several versions of VB, and I'd like to keep its rewriting to a minimum. Basically, it is used in this...
4
by: mpreston | last post by:
I'm following the example from the MSDN library on how to create modal dialog boxes in C#, but something isn't working properly. If I create a modal dialog box and show it using ShowDialog(), the...
3
by: Tony Johansson | last post by:
Hello! I have a modal dialog lets call it TestDialog that is shown by using method showDialog(). This TestDialog has three controls it's one richtextbox and two buttons. The buttons is one Ok...
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
3
by: nick_nw | last post by:
Hi All, I think I'm missing a basic bit of understanding with modal forms. This is the problem I have: 1. User clicks button on form, event handler throws an exception. 2. In catch block a...
4
by: active | last post by:
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...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
1
by: Frank Rizzo | last post by:
I am not grokking the difference between Form.ShowDialog() and Form.ShowDialog(this). I have a form (parent form) that kicks off a modal dialog using Form.ShowDialog(). The modal dialog has a 3rd...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.