Autor Beitrag
chrisx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Sa 06.11.04 16:42 
hallo,
ich habe ein programm ,auf dem ich 2 editfelder. das programm soll überprüfen, ob der innhalt der beiden eingabefelder gleich ist.(für eine passwortkontrolle)


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.KeyPress(Sender: TObject; var Key: Char);
var
pass: String ;
pass1:String ;

begin
pass:= Edit2.text;
pass1:=Edit3.Text;
if pass=pass1 then
Form1.Close();


end;


kann mir jemand helfen,
es ist zwar eine totale anfänger frage, aber ich komm net drauf
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 06.11.04 16:51 
source funzt doch... :gruebel:

Vieleicht funktioniert dein KeyPress nicht? :nixweiss:

(Übrigens brauchst du es nicht unbedingt erst in Strings zu schreiben)
chrisx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Sa 06.11.04 17:07 
naja, danke.
dann werde ich mir eine andere lösung suchen, wenn meine Key funktionen nur teilweise funktionieren
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 06.11.04 17:12 
KeyDown müsste funktionieren.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Sa 06.11.04 20:17 
Wenn du überprüfen willst ob Edit1 = Edit2 ist, dann darfst du dass aber nicht ins TForm Event schreiben! Das wird nur ausgeführt wenn die Form aktiviert ist, und auch nur wenn eine bestimmte Taste gedrückt wird (siehe Key : Char)

Du musst die Überprüfung ins OnChange Event deiner Editfelder schreiben!