Autor Beitrag
matzehl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mi 02.02.05 12:27 
Morgenschön!!!!!!!!!!!!!

Und schon mal sorry für diese wirklich,wirklich dumme Frage. Aber ich komm einfach nich weiter. Ich will doch nur abfragen ob die Entf Taste innerhalb einer Editbox gedrückt wurde. Und das will ich im KeyPress Event erledigen wenn's geht. Ich will diesen Tastendruck herausfiltern. Aber es klappt nich!!! Ich zweifel schon an mir. :oops:

Zum Beispiel:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
begin
if key = ord(VK_DELETE) then showMessage('Entf gedrückt!');
end;


oder

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
begin
if key = ord('VK_DELETE'then showMessage('Entf gedrückt!');
end;


funzen nich

MfG

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
st-matze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 138

Win 3.11, Win 95, Win 98, Win XP
D7 Ent, D6 Pers, (D5 Pers)
BeitragVerfasst: Mi 02.02.05 12:33 
bestimmte Tasten u.A. auch Entf können nur im OnKeyDown und OnKeyUp ausgelesen werden und nicht im OnKeyPress

nimm nen anderes Event und es funzt
näheres siehe OnlineHilfe

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key = VK_DELETE then showMessage('Entf gedrückt!');
end;
matzehl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: Mi 02.02.05 12:41 
Hm, etwas umständlich, aber wenn's nich anders geht werd ich's wohl so machen müssen. Wußte ich nicht, dass das nicht geht. Auf jeden Fall danke für die schnelle Hilfe! :D

MfG