unit Train;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Borland.Vcl.StdCtrls, System.ComponentModel;
type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; GroupBox1: TGroupBox; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label16: TLabel; Label17: TLabel; Label18: TLabel; ComboBox1: TComboBox; ComboBox2: TComboBox; ComboBox3: TComboBox; ComboBox4: TComboBox; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2: TButton; Label8: TLabel; Label19: TLabel; procedure Edit2Change(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.nfm}
procedure TForm1.Edit2Change(Sender: TObject);beginlabel19.Caption:=datetimetostr(now);end;
procedure TForm1.Button1Click(Sender: TObject);beginif combobox1.Itemindex=0 thenif combobox2.itemindex=0 thenif edit1.text='1' thenedit2.text:='20000'elseif combobox1.Itemindex=0 thenif combobox2.itemindex=0 thenif edit1.text='2' thenedit2.text:='40000';beginif combobox1.Itemindex=0 thenif combobox2.itemindex=1 thenif edit1.text='1' thenedit2.text:='30000'elseif combobox1.Itemindex=0 thenif combobox2.itemindex=1 thenif edit1.text='2' thenedit2.text:='60000';beginif combobox1.Itemindex=0 thenif combobox2.itemindex=2 thenif edit1.text='1' thenedit2.text:='40000'elseif combobox1.Itemindex=0 thenif combobox2.itemindex=2 thenif edit1.text='2' thenedit2.text:='80000';beginif combobox1.Itemindex=1 thenif combobox2.itemindex=0 thenif edit1.text='1' thenedit2.text:='10000'elseif combobox1.Itemindex=1 thenif combobox2.itemindex=0 thenif edit1.text='2' thenedit2.text:='20000';beginif combobox1.Itemindex=1 thenif combobox2.itemindex=1 thenif edit1.text='1' thenedit2.text:='15000'elseif combobox1.Itemindex=1 thenif combobox2.itemindex=1 thenif edit1.text='2' thenedit2.text:='30000';beginif combobox1.Itemindex=1 thenif combobox2.itemindex=2 thenif edit1.text='1' thenedit2.text:='25000'elseif combobox1.ItemIndex=1 thenif combobox2.ItemIndex=2 thenif edit1.text='2' thenedit2.Text:='50000';end;end;end;end;end;end;
procedure TForm1.Button2Click(Sender: TObject);begincombobox1.ClearSelection;combobox2.clearselection;combobox3.ClearSelection;combobox4.ClearSelection;edit1.clear;edit2.clear;end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);beginif not(key in['1'..'2',#2])thenkey:=#0;end;
end.
Friday, November 2, 2007
Thursday, October 18, 2007
Subscribe to:
Posts (Atom)