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

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, Menus;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     MainMenu1: TMainMenu;
  12.     Demo1: TMenuItem;
  13.     Stayontop1: TMenuItem;
  14.     Exit1: TMenuItem;
  15.     procedure Exit1Click(Sender: TObject);
  16.     procedure Stayontop1Click(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   MainForm: TMainForm;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TMainForm.Exit1Click(Sender: TObject);
  31. begin
  32.   Close;
  33. end;
  34.  
  35. procedure TMainForm.Stayontop1Click(Sender: TObject);
  36. begin
  37.   with Sender as TMenuItem do
  38.   begin
  39.     Checked := not Checked;
  40.     if Checked
  41.       then FormStyle := fsStayOnTop
  42.       else FormStyle := fsNormal;
  43.   end;
  44. end;
  45.  
  46. end.
  47.  
  48.