Solved

How to make form modal

Posted on 2002-04-17
6
409 Views
Last Modified: 2010-04-04

How can I make a Delphi form modal, so the "underlaying" form(s) is/are blocked....

Alk
0
Comment
Question by:roczalk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 50 total points
ID: 6947434
Somewhere you call Form.Show. Replace by Form.ShowModal.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6947445
yep, thats it
0
 
LVL 3

Expert Comment

by:VSF
ID: 6947448
if your form is not created automatically at runtime just do:

Procedure TForm1.Button1Click(Sender: TObject);
begin
 application.createform(TForm2, Form2);
 Form2.Showmodal;
end;

It is important to remember that modal forms can not be MDiChild and they will stay on top until you call the form's OnCloseEvent:

Action:=CaFree;


Hope it helps!
VSF
www.victory.hpg.com.br
www.boatoda.hpg.com.br
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6947471
hmm,

i usual use something like this

begin
  with tFormWhichShouldBeShowedModal.create(self) do
  try
    showmodal;  
    //or if modalresult is needed
    //mres := showmodal;
    //
    //maybe transport some values from the form
    //for further process
    somevar := EditControlOnModalForm.text;
  finally
    release;
  end;
end;
   
meikl ;-)
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6947764
Do not call CreateForm. Create is good enough.
0
 

Author Comment

by:roczalk
ID: 6948288
Thanks all for the response.
I did indeed find the ShowModal, but was surprised I couldn't place this setting on the form properties itself.

As Robert was the first with th esolution, I'll reward him with the points, but I'm also gratefull for the other comments. Thanks guy's ;-)

Alk
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question