Salvar o conteúdo de um CheckListBox com TFileStream

Delphi

05/04/2015

Olá!
Alguém já conseguiu salvar o conteúdo de um CheckListBox com TFileStream?

Com o meu código que segue abaixo não retorna com os itens checados.

Var
strm : TFileStream;

Begin

   strm := TFileStream.Create(ExtractFilePath(Application.ExeName)+'BKP.DAT', fmCreate);

   strm.WriteComponent(CheckListBox1);

   strm.Free;

end;



var
strm : TFileStream;

begin

 if FileExists(ExtractFilePath(Application.ExeName)+'BKP.DAT') then
 begin

      strm := TFileStream.Create(ExtractFilePath(Application.ExeName)+'BKP.DAT', fmOpenRead);

      strm.ReadComponent(CheckListBox1);

      strm.Free;

  end;



Muito obrigado!
Ilton Ornelas

Ilton Ornelas

Curtidas 0
POSTAR