October 28th, 2012, 02:52 PM
Problem when canceling OpenPictureDialog
I have this problem.
When I open "OpenPictureDialog" and click Cancel Button i get this message UNKNOWN PICTURE FILE EXTENSION (.)
October 29th, 2012, 12:34 AM
Without posting the code that causes the error, at best we can only guess as to what is happening.
Given that, my guess is that you are not "Executing" the dialog correctly.
if OpenPictureDialog.Execute then
//the file selected will be in
//only do the "loadfromfile" if the dialog is executed
//otherwise the user clicked cancel
October 29th, 2012, 01:53 AM
Originally Posted by majlumbo
Sorry about code.
here it is
October 29th, 2012, 09:04 AM
You need to test to see if the user actually executed the dialog box (hits the ok button, vs. the cancel button.
procedure TFMain.ChooseClick(Sender: TObject);
sDir : string;
if OpenPictureDialog1.Execute then
sDir := OpenPictureDialog1.FileName;
October 29th, 2012, 03:46 PM