Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

Clearing prior image OpenPictureDialog1before execute

Hi All,
I want to clear the OpenPictureDialog preview panel before each execute so that it opens
with a blank as if it was the first time. In the nomal operation the last selection is on the preview.
Any help and an example would be appreciated.

Delphi3
0
delphi3
Asked:
delphi3
  • 3
  • 2
1 Solution
 
JaymolCommented:
Just a guess, but try this...

  With TOpenPictureDialog.Create(nil) do begin
    FileName:='';
    Execute;
    Free;
  end;

John.
0
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

  Clear the file name before you call the execute method

  OpenPictureDialog1.FileName :='';
  if OpenPictureDialog1.Execute then
 ......

Best regards
Mohammed Nasman
0
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

  Clear the file name before you call the execute method

  OpenPictureDialog1.FileName :='';
  if OpenPictureDialog1.Execute then
 ......

Best regards
Mohammed Nasman
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
delphi3Author Commented:
Mohammed,
What you have suggested does not work. The prior picture is still there when going to load the next picture.
Can you think of another possibility?

Delphi3
0
 
Mohammed NasmanSoftware DeveloperCommented:
delphi3, I tested my code and it's work fine

can you plz, post ur code that show the OpenPictureBox, and which event you use?


Mohammed
0
 
delphi3Author Commented:
Mohammed,
My apologies for not testing your answer as written. It does indeed work fine.
I thank you very much.

Delphi3
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now