home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programming Unleashed / Delphi_Programming_Unleashed_SAMS_Publishing_1995.iso / misc / objects / buttons / main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-21  |  1.0 KB  |  50 lines

  1. unit Main;
  2.  
  3. { Program copyright (c) 1995 by Charles Calvert }
  4. { Project Name: BUTTONS }
  5.  
  6. interface
  7.  
  8. uses
  9.   WinTypes, WinProcs, Classes,
  10.   Graphics, Controls, Forms,
  11.   StdCtrls;
  12.  
  13. type
  14.   TForm1 = class(TForm)
  15.     Button1: TButton;
  16.     procedure Button1Click(Sender: TObject);
  17.     procedure FlashButtonClick(Sender: TObject);
  18.   private
  19.     FlashButton: TButton;
  20.     MyFont: TFont;
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TForm1.Button1Click(Sender: TObject);
  31. begin
  32.   FlashButton := TButton.Create(Form1);
  33.   FlashButton.Parent := Form1;
  34.   FlashButton.SetBounds(200, 20, 180, 110);
  35.   FlashButton.Default := True;
  36.   FlashButton.Caption := ' Sam ';
  37.   FlashButton.Font.Name := 'New Times Roman';
  38.   FlashButton.Font.Color := clBlue;
  39.   FlashButton.Font.Size := 46;
  40.   FlashButton.Font.Style := [fsItalic];
  41.   FlashButton.OnClick := FlashButtonClick;
  42. end;
  43.  
  44. procedure TForm1.FlashButtonClick(Sender: TObject);
  45. begin
  46.   MessageBox(Handle, 'Click on Flash Button', 'Info', mb_Ok);
  47. end;
  48.  
  49. end.
  50.