unit fileDrop;
interface
uses
Forms, ListBoxWithFileDrop, Controls, StdCtrls, Classes;
type
TMainDemoForm = class(TForm)
ListBoxWithFileDrop: TListBoxWithFileDrop;
chkAcceptFileDrop: TCheckBox;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label1: TLabel;
Label5: TLabel;
procedure FormCreate(Sender: TObject);
procedure ListBoxWithFileDropFileDrop(Sender: TObject;
FileName: String; X, Y: Integer);
procedure chkAcceptFileDropClick(Sender: TObject);
procedure FormResize(Sender: TObject);
end;
var
MainDemoForm: TMainDemoForm;
implementation
{$R *.dfm}
procedure TMainDemoForm.FormCreate(Sender: TObject);
begin
ListBoxWithFileDrop.AcceptFileDrop:=chkAcceptFileDrop.Checked;
end;
procedure TMainDemoForm.ListBoxWithFileDropFileDrop(Sender: TObject;
FileName: String; X, Y: Integer);
begin
ListBoxWithFileDrop.Items.Add(FileName);
end;
procedure TMainDemoForm.chkAcceptFileDropClick(Sender: TObject);
begin
ListBoxWithFileDrop.AcceptFileDrop := chkAcceptFileDrop.Checked;
end;
procedure TMainDemoForm.FormResize(Sender: TObject);
begin
ListBoxWithFileDrop.Width:=self.ClientWidth - 2* ListBoxWithFileDrop.Left;
ListBoxWithFileDrop.Height:=self.ClientHeight - ListBoxWithFileDrop.Top;
end;
end.