1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71:
| unit FahrAutomat;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,JPEG;
type TForm1 = class(TForm) ZielCBx: TComboBox; ZielLb: TLabel; AnzahlLb: TLabel; AnzahlEd: TEdit; titelnameIMG: TImage; Ok1BT: TButton; procedure FormCreate(Sender: TObject); procedure ZielCBxChange(Sender: TObject); procedure Ok1BTClick(Sender: TObject); private public end;
var Form1: TForm1; Fz: Array[1..10] of String =('Berlin','New York','Pekin','Warschau','Athen','Rom','Paris','Tokyo','Mexiko city','Mond'); Fp:Array[1..10] of real=(3.50,5.50,4.70,8.70,14.20,8.90,24.90,55.60,7.50,25000.00); Bild:TImage; Anzahl:byte; Preis:real; index:byte;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject); var i:byte; Stadt:string; begin titelnameIMG.Picture.LoadfromFile ('titelname.BMP'); ZielCBx.clear; ZielCBx.text:='Fahrziel'; For i:=1 to 10 do begin Stadt:=FZ[i]; ZielCBx.Items.Add(Stadt); end;
end;
procedure TForm1.ZielCBxChange(Sender: TObject);
begin index:=ZielCBx.ItemIndex+1; AnzahlLb.visible:=true; AnzahlEd.visible:=true; end;
procedure TForm1.Ok1BTClick(Sender: TObject); begin Anzahl:=strtoint (AnzahlEd.text); Preis:=(Anzahl) * (Fp[index]); Form2.Show; end;
end. |