Autor Beitrag
icedre
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Windows XP Prof. , SuSE Linux 9.0 Prof.
Borland Delphi 6.0 Enterprise
BeitragVerfasst: Do 17.02.05 14:29 
Hallo,

ich hab da ein kleines Problem...

Ich möchte mir ein Interface basteln, mit dem ich über einzelne Buttons (0 bis 9), Zahlen in ein Editfeld eingeben kann. Wird z.B. der Button "1" gedrückt, soll dem Editfel die Zahl 1 hinzugefügt werden.

Jetzt kenn ich leider nur den Weg über Edit1.Text:=''. Ich möchte aber, dass wenn man Button 1, 3, 7, 5 nacheinander drückt, diese Zahlen dann im Editfeld eingetragen werden, so ne Art "Passwort-Tasten-Feld" (?).

Für andere Lösungen (evt. ohne Editfeld) bin ich natürlich auch offen.

Vielen Dank für die Hilfe

_________________
Sprach Abraham zu Braham:
Kann ich deine Frau besamen
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Do 17.02.05 14:40 
Hallo"

In dem OnClick-Event der Buttons packst du folgendes rein:

ausblenden Delphi-Quelltext
1:
2:
If Sender is TButton Then
  Edit1.Text := Edit1.Text + TButton (Sender).Caption;


Gruß
Tino
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 17.02.05 14:41 
Du kannst auch folgendes machen:
ausblenden Delphi-Quelltext
1:
Edit1.Text := Edit1.Text + '1';					

Das wäre z.B. die Routine, die beim Button für die 1 gemacht werden müsste.

//EDIT: Tino was faster
icedre Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Windows XP Prof. , SuSE Linux 9.0 Prof.
Borland Delphi 6.0 Enterprise
BeitragVerfasst: Do 17.02.05 18:17 
Hey danke !

Hät ich gleich drauf kommen können, aber trotzdem vielen Dank für die schnellen Antworten !

Bis Dann

_________________
Sprach Abraham zu Braham:
Kann ich deine Frau besamen