Discussion:
Repaint main form
(too old to reply)
Morten Mosgaard
2007-09-17 09:55:55 UTC
Permalink
Hi,
My project consists of a form. When I press a button on the form the
application starts some calculations, which takes maybe 200 seconds to
complete.
My problem is that when I execute the application by the .exe file after 10
seconds the form becomes grey, and I cant see any of the controls.
I have an Repaint() every 2 seconds, but it does not help anything.

How do I get the form updated, so I can see the controls while the
application is running?

Regards,
Morten
<< Wiljo >>
2007-09-17 11:24:45 UTC
Permalink
Post by Morten Mosgaard
Hi,
My project consists of a form. When I press a button on the form the
application starts some calculations, which takes maybe 200 seconds to
complete.
My problem is that when I execute the application by the .exe file after 10
seconds the form becomes grey, and I cant see any of the controls.
I have an Repaint() every 2 seconds, but it does not help anything.
How do I get the form updated, so I can see the controls while the
application is running?
Regards,
Morten
Hi,
It might help if you add Application->ProcessMessages() inside your
calculation at regular intervals, but not too often, and not too few. At
the moment all windows messages are blocked by these calculations. Take
care though that this allows the user interface to be fully active
again, and buttons, menu items and such can be fired again by user
interaction. You must disable these temporarily until your calculations
are finished. This should help you resolve update issues.
Wiljo.
Morten Mosgaard
2007-09-17 12:22:58 UTC
Permalink
Thanks that did the job :)
Post by << Wiljo >>
Post by Morten Mosgaard
Hi,
My project consists of a form. When I press a button on the form the
application starts some calculations, which takes maybe 200 seconds to
complete.
My problem is that when I execute the application by the .exe file after
10 seconds the form becomes grey, and I cant see any of the controls.
I have an Repaint() every 2 seconds, but it does not help anything.
How do I get the form updated, so I can see the controls while the
application is running?
Regards,
Morten
Hi,
It might help if you add Application->ProcessMessages() inside your
calculation at regular intervals, but not too often, and not too few. At
the moment all windows messages are blocked by these calculations. Take
care though that this allows the user interface to be fully active again,
and buttons, menu items and such can be fired again by user interaction.
You must disable these temporarily until your calculations are finished.
This should help you resolve update issues.
Wiljo.
Remy Lebeau (TeamB)
2007-09-17 18:04:58 UTC
Permalink
Post by Morten Mosgaard
I have an Repaint() every 2 seconds, but it does not help anything.
Use Update() instead of Repaint().


Gambit

Continue reading on narkive:
Loading...