Board index » delphi » Repainting a screen

Repainting a screen

I have an application which accesses both an SQL server and an AS/400
database simultaneously for data and will run for up to 45 minutes.
When the user(s) run the app their screen often does not repaint
itself and there are long periods (up to 30 seconds) where they can
view nothing. The app has a cancel button so that the user may stop
the process running. However, the app will accept no input from the
user at all.
 I have placed the following statements in various places in the
applications (inside loops etc).

FrmStickers.Repaint;
Application.ProcessMessages;

This helped a bit (The user can now cancel the run) so I placed the
same code within a TTimer wich fires off at an interval of 1000.

This appeared to make no difference to the form repaint.

Can anyone point out the error of my ways.

Any help appreciated.

Thanks in advance

Iain

 

Re:Repainting a screen


"Iain Wilson" <iwil...@dundee.tokheim.com> skrev i melding
news:2174c13c.0111170048.3f2094a3@posting.google.com...

Quote
> I have an application which accesses both an SQL server and an AS/400
> database simultaneously for data and will run for up to 45 minutes.
> When the user(s) run the app their screen often does not repaint
> itself and there are long periods (up to 30 seconds) where they can
> view nothing. The app has a cancel button so that the user may stop
> the process running. However, the app will accept no input from the
> user at all.
>  I have placed the following statements in various places in the
> applications (inside loops etc).

> FrmStickers.Repaint;
> Application.ProcessMessages;

> This helped a bit (The user can now cancel the run) so I placed the
> same code within a TTimer wich fires off at an interval of 1000.

> This appeared to make no difference to the form repaint.

> Can anyone point out the error of my ways.

To make it really responsive, you need to run the query in a separate thread.

--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorge@takethisaway_itte.no (remve the obvious)

Other Threads