Solved

Application.ProcessMessages method...

Posted on 1998-09-13
5
161 Views
Last Modified: 2010-04-06
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
Comment
Question by:keithcsl
  • 2
  • 2
5 Comments
 
LVL 1

Author Comment

by:keithcsl
ID: 1339629
Edited text of question
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339630
Try maybe Application.HandleMessaage?
0
 
LVL 10

Accepted Solution

by:
viktornet earned 70 total points
ID: 1339631
use this inside your loop.........

break;
//close the form
continue;

Regards,
Viktor Ivanov
0
 
LVL 1

Author Comment

by:keithcsl
ID: 1339632
viktornet

thank you for your answer.

Regards
Keith
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339633
No prob :-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now