home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / TDROPFL.ZIP / TMultiDropFile / Demo / Demo Source (Delphi) / Unit1.~pa < prev    next >
Encoding:
Text File  |  1998-02-14  |  1.2 KB  |  57 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ExtCtrls, ComCtrls, MultiDropFile;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     MultiDropFile1: TMultiDropFile;
  12.     ListBox1: TListBox;
  13.     StatusBar1: TStatusBar;
  14.     Image1: TImage;
  15.     Label1: TLabel;
  16.     procedure FormShow(Sender: TObject);
  17.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  18.     procedure MultiDropFile1FileDrop(Sender: TObject;
  19.       numberOfFiles: Integer);
  20.   private
  21.     { Private declarations }
  22.   public
  23.     { Public declarations }
  24.   end;
  25.  
  26. var
  27.   Form1: TForm1;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. procedure TForm1.FormShow(Sender: TObject);
  34. begin
  35.   MultiDropFile1.enableDropFile(form1.handle);
  36. end;
  37.  
  38. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  39. begin
  40.   MultiDropFile1.disableDropFile;
  41. end;
  42.  
  43. procedure TForm1.MultiDropFile1FileDrop(Sender: TObject;
  44.   numberOfFiles: Integer);
  45. Var
  46.   n: Integer;
  47. begin
  48.   ListBox1.clear;
  49.   statusBar1.simpleText:=intToStr(numberOfFiles) + ' files dropped';
  50.   for n:=1 to numberOfFiles do
  51.     begin
  52.       listbox1.items.add(MultiDropFile1.FileName[n]);
  53.     end;
  54. end;
  55.  
  56. end.
  57.