• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

Application.ProcessMessages method...

Hi

I have a loop in a form (say Form1) that goes:
 
  while True do
    Application.ProcessMessages;

This allows others things to happen at the same time BUT when I open a MODAL form (ie using Form2.ShowModal), I can't close the form. The OnClose event will not take place unless I terminate the loop in Form1.

How do I solve this problem?, ie to be able to open and close Form2 (as a modal form) with the loop still running in Form1.

Regards
Keith
0
keithcsl
Asked:
keithcsl
  • 2
  • 2
1 Solution
 
keithcslAuthor Commented:
Edited text of question
0
 
MatveyCommented:
Try maybe Application.HandleMessaage?
0
 
viktornetCommented:
use this inside your loop.........

break;
//close the form
continue;

Regards,
Viktor Ivanov
0
 
keithcslAuthor Commented:
viktornet

thank you for your answer.

Regards
Keith
0
 
viktornetCommented:
No prob :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now