witam
mam do napisania w delphi komponent oparty o ComboBox ma byc w nim uzyty filtr katalog i po nim wlasnie ma wyswietlac w ComboBox'ie. czy ktos moze sprawdzic czego brakuje w kodzie zeby wszystko dzialalo? trzeba dodac jakies propertis, ja nie mam pojecia jakie. z gory dzieki za pomoc
unit moj;
interface
uses
SysUtils, Classes, Controls, StdCtrls;
type
Tmoj = class(TComboBox)
private
Katalog: string;
rozszerzenie: string;
FileList: TStrings;
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Katalog: string read.........write........
property rozszerzenie: string read....... write........
procedure PlikiZKatalogu;
end;
procedure Register;
implementation
procedure Tmoj.PlikiZKatalogu ;
var
SR: TSearchRec;
begin
if FindFirst(Katalog + rozszerzenie, faAnyFile, SR) = 0 then
begin
repeat
if (SR.Attr <> faDirectory) then
begin
FileList.Add(SR.Name);
end;
until FindNext(SR) <> 0;
FindClose(SR);
end;
end;
procedure Register;
begin
RegisterComponents('Standard', [Tmoj]);
end;
end.