OpenDialog and SaveDialog Troubles and sullutions

  Hello all;
Thought that I would post this on here, since I did not get that many
replies and solutions
to the problem that I was having before.
  What was happening?  My TOpenDialog and TSaveDialog would not keep the
filter that
I assigned to them in the Object Inspector [Filter] Properties.
I could not for the life of figure this out. And it had been going on since
prior to Christmas.
Mike Orriss (TeamB and DevExpress)  wanted me to post a sample source with
the
problem accruing to the Public.attachments. I tried and tried and it would
work great.
(guess Delphi got scared of TeamB) :~)
So after not being able to re-create the problem. I decided to go into
code under the [ open1click, save1click and saveas1click] buttons in my
project and try the
following. This works like a charm. So if anyone ever has this problem.
Where their Open and SaveDialog (s)
loose their Filter when they run the program. This is what you need to do.

procedure TMainForm.Open1Click(Sender: TObject);
begin
//add this as the 1st line in the code. this way it is called first on
launch.
  OpenDialog1.Filter := 'HTML (*.html;*.htm)|*.html;*.htm|TXT
(*.txt)|*.txt';//along with the rest of the filters list
//rest of the code. Do this same thing to the Save1Click and SaveAs1Click as
well
end;
//if you have allot of filter. The best way to do this:
In Object Inspector click on the Filter List.(Do not launch the Filter
Editor) when you see them
highlighted press Ctrl+C and then go over into the code where you already
have

  OpenDialog1.Filter := ' ';
and past the filters between the   '  ';
and then compile and run.
Works like a charm. You can even take all the filters out of the Filter
properties in the Object inspector
and just do it in code.

  But this cured the issue that I was having. Still do not know what caused
it to begin with.
Not unless something in my code somewhere was conflicting with the Dialogs
on launch.

  Take Care and hope that this will help someone out one day.

Thank You

Wayne

--
[Wayne & Carr]
[Carrz-Fox-Fire Promotions]
[ http://www.carrz-fox-fire.dynip.com/Delphi/Fire_Delphi.htm ]
[Win2k | SP1 | Delphi 6 Pro]