Re:Open/Save Dialog Boxes
On Sat, 5 Aug 2000 12:35:13 -0400, "George Kwascha"
Quote
<kas...@mindspring.com> wrote:
>Can anyone provide me some guidance?
I'm having an awfully hard time understanding what you are doing from
your description (and it also seems highly unorthodox) but I assure
you the assignment --
SaveDialog.FileName:= OpenDialog.FileName;
does "work" in that the value of the OpenDialog.FileName property is
assigned to the SaveDialog.FileName property. The problem is that it
probably occurs at a time you aren't expecting.
You said you did it in "OnShow", by which I assume you mean you've
done it in the OpenDialog's OnShow event. This is too early, as the
event fires immediately when the dialog is shown, not much later after
the user uses the dialog to select a file name.
Here's a code snippet which does what I think you want:
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog.Execute then
begin
SaveDialog.FileName := OpenDialog.FileName;
SaveDialog.Execute;
end;
end;
--
Rick Rogers (TeamB)
www.fenestra.com and www.componentfactory.com