home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / COMBOS / MAIN.PAS < prev   
Pascal/Delphi Source File  |  1998-04-13  |  1KB  |  60 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     SimpleCB: TComboBox;
  12.     DropDownCB: TComboBox;
  13.     DropDownListCB: TComboBox;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     Label3: TLabel;
  17.     CancelBitBtn: TBitBtn;
  18.     OKBitBtn: TBitBtn;
  19.     CloseBitBtn: TBitBtn;
  20.     procedure CancelBitBtnClick(Sender: TObject);
  21.     procedure OKBitBtnClick(Sender: TObject);
  22.     procedure CloseBitBtnClick(Sender: TObject);
  23.   private
  24.     { Private declarations }
  25.   public
  26.     { Public declarations }
  27.   end;
  28.  
  29. var
  30.   MainForm: TMainForm;
  31.  
  32. implementation
  33.  
  34. {$R *.DFM}
  35.  
  36. procedure TMainForm.CancelBitBtnClick(Sender: TObject);
  37. begin
  38.   Close;
  39. end;
  40.  
  41. procedure TMainForm.OKBitBtnClick(Sender: TObject);
  42. var
  43.   S1, S2, S3: string;
  44. begin
  45.   S1 := SimpleCB.Text;
  46.   S2 := DropDownCB.Text;
  47.   S3 := DropDownListCB.Text;
  48.   ShowMessage('Your selections are: ' +
  49.     S1 + ', ' + S2 + ', ' + S3);
  50. end;
  51.  
  52. procedure TMainForm.CloseBitBtnClick(Sender: TObject);
  53. begin
  54.   OKBitBtn.Click;  { Simulate OK button click }
  55.   Close;           { End program }
  56. end;
  57.  
  58. end.
  59.  
  60.