home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 December / Chip_2002-12_cd1.bin / zkuste / delphi / kompon / d234567 / MAGNET.ZIP / Demo / Main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2002-09-23  |  988 b   |  55 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Classes, Controls, Forms, StdCtrls, Buttons, ExtCtrls,
  7.   FormMagnet;
  8.  
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Panel1: TPanel;
  13.     BitBtn1: TBitBtn;
  14.     BitBtn2: TBitBtn;
  15.     ScrollBox: TScrollBox;
  16.     Label1: TLabel;
  17.     Label2: TLabel;
  18.     FormMagnet1: TFormMagnet;
  19.     procedure BitBtn1Click(Sender: TObject);
  20.     procedure BitBtn2Click(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. uses Unit2, Unit3;
  35.  
  36. procedure TForm1.BitBtn1Click(Sender: TObject);
  37. var
  38.   TempForm: TWindow;
  39. begin
  40.   Application.CreateForm(TWindow, TempForm);
  41.   TempForm.Visible := True;
  42. end;
  43.  
  44. procedure TForm1.BitBtn2Click(Sender: TObject);
  45. var
  46.   TempForm: TSubWindow;
  47. begin
  48.   Application.CreateForm(TSubWindow, TempForm);
  49.   TempForm.Left := 0;
  50.   TempForm.Top := Panel1.Height + 2;
  51.   TempForm.Parent := ScrollBox;
  52. end;
  53.  
  54. end.
  55.