Page 1 of 1

Cancel Loading RTF

Posted: Tue Apr 17, 2007 8:43 pm
by topcat
When an RTF is loaded from a memorystream is it possible to cancel the progress during loading. How do I do this safely?

The reason I ask is because I have a dialog box containing a cancel button which displays when an RTF file is loading. I would like the cancel button to stop the loading process.

Thanks for your time!

Posted: Wed Apr 18, 2007 4:37 am
by Sergey Tkachenko
I did not think about it... But I believe calling Abort in OnProgress must work.

Posted: Thu Apr 19, 2007 7:55 am
by topcat
I used the following to cancel loading rtf:

rtfAbort : boolean=False; // global var

cancel button event:

rtfAbort := True;

in the OnProgress event for trichview:

if rtfAbort then
begin
Richeditview1.clear;
Abort;
end;