home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / LISTTEXT / MAIN.PAS < prev   
Pascal/Delphi Source File  |  1998-04-13  |  850b  |  48 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Menus;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     MainMenu: TMainMenu;
  12.     File1: TMenuItem;
  13.     Open1: TMenuItem;
  14.     Exit1: TMenuItem;
  15.     OpenDialog: TOpenDialog;
  16.     MemoText: TMemo;
  17.     procedure Open1Click(Sender: TObject);
  18.     procedure Exit1Click(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   MainForm: TMainForm;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. procedure TMainForm.Open1Click(Sender: TObject);
  33. begin
  34.   if OpenDialog.Execute then
  35.   begin
  36.     MemoText.Lines.LoadFromFile(OpenDialog.Filename);
  37.     MainForm.Caption := OpenDialog.Filename;
  38.   end;
  39. end;
  40.  
  41. procedure TMainForm.Exit1Click(Sender: TObject);
  42. begin
  43.   Close;
  44. end;
  45.  
  46. end.
  47.  
  48.