Re: Disabling an application during a file save?





On Oct 9, 3:19 pm, Steve <s...@xxxxxxxxxxx> wrote:
Bit of a newbie.

I have an application with several forms, each with a number of
buttons on them.

Some of the buttons call a procedure which writes some data to disk.
This process occasionally takes a few seconds. Is there a way to
prevent any other buttons/actions being acting on while it's saving?

I believe you can use form1.enabled:=false to prevent buttons on that
form being pressed, but can you do that for the entire application all
in one go?

You could code an Application.OnMessage event and set Handled to a flag
you set and clear before and after the file-saving code. But you should
then indicate to the user the progress of the file saving and that
would involve allowing messages which control the progress indicator to
be sent to the indicator (ie by setting Handled to false for those
messages).

Alan Lloyd

.


Quantcast