Board index » delphi » StayOnTop and MessageDLG

StayOnTop and MessageDLG

I have a problem with some forms I'm using in my program.

When I prompt the user to enter data, I do so by opening a smaller
form on top the one that was displaying. Since this new form i alot
smaller than the other, and I only want the user to be able to exit
the form by pressing OK or Cancel, I have made the form StayOnTop and
removed all the max/min/close icons.

2 problem occure:

1. The user can still access the form behind by simply pressing it. My
small form still is on top, but the one behind becomes the active one.
This I do not want the user to be able to do.

2. When using the MessageDLG, the messagebox is displayed *under* the
small form, even if I issued it after I opened the small form.

 

Re:StayOnTop and MessageDLG


pedro.thormod...@login.eunet.no (Pedro E. Thormodsen) wrote:

Quote
>I have a problem with some forms I'm using in my program.

>When I prompt the user to enter data, I do so by opening a smaller
>form on top the one that was displaying. Since this new form i alot
>smaller than the other, and I only want the user to be able to exit
>the form by pressing OK or Cancel, I have made the form StayOnTop and
>removed all the max/min/close icons.

>2 problem occure:

>1. The user can still access the form behind by simply pressing it. My
>small form still is on top, but the one behind becomes the active one.
>This I do not want the user to be able to do.

>2. When using the MessageDLG, the messagebox is displayed *under* the
>small form, even if I issued it after I opened the small form.

You should use ShowModal to open that form, instead of Show.

Good luck!

Jasper

PS: please take into consideration
- when replying, I just think I know;
- when asking, be sure that I don't.

Re:StayOnTop and MessageDLG


In article <4ogo3q$...@elle.eunet.no>,
pedro.thormod...@login.eunet.no (Pedro E. Thormodsen) wrote:

Quote
>I have a problem with some forms I'm using in my program.

>When I prompt the user to enter data, I do so by opening a smaller
>form on top the one that was displaying. Since this new form i alot

This seems quite easy: Open your data entry window with
YourForm.ShowModal instead of YourForm.Show. A mouseclick outside
of the modal window will only give a short beep now.  But be aware
that the rest of your application is now really 'frozen' until
your user closes the modal form!  I believe this is what you
want, but just to be sure...

Bye, mq

---------------------------------------------------------------
Markus Quandt                  a2137...@athena.rrz.uni-koeln.de
Cologne, Germany
---------------------------------------------------------------

Other Threads