home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue31 / cm20 / CM20.ZIP / Demo / cm_pasc.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-11-12  |  845 b   |  49 lines

  1. unit cm_pasc;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, ColMemo;
  8.  
  9. type
  10.   TFrmPascalDemo = class(TForm)
  11.     ColorMemo1: TColorMemo;
  12.     Label13: TLabel;
  13.     eFile: TEdit;
  14.     btnFile: TButton;
  15.     ODlg: TOpenDialog;
  16.     procedure btnFileClick(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.     procedure LoadIt;
  22.   end;
  23.  
  24. var
  25.   FrmPascalDemo: TFrmPascalDemo;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TFrmPascalDemo.btnFileClick(Sender: TObject);
  32. begin
  33.      if ODlg.Execute then
  34.      begin
  35.           eFile.Text:=ODlg.FileName;
  36.           LoadIt;
  37.      end;
  38. end;
  39.  
  40. procedure TFrmPascalDemo.LoadIt;
  41. begin
  42.      try
  43.         ColorMemo1.Lines.LoadFromFile(eFile.Text);
  44.      except
  45.      end;
  46. end;
  47.  
  48. end.
  49.