Autor Beitrag
HaRaH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Sa 05.02.05 19:31 
hallo,
gibt es eine Möglichkeit beim Drücken einer Taste in einem RichEdit-Steuerelement festzustellen, ob und welche eine Pfeiltaste gedrückt wurde?
in der Prozedur onPress gibt es einen Key vom Typ Char. Dieser enthält zwar Buchstaben, die gedrückt wurden, aber behält diesen Wert, wenn auf eine Pfeiltaste gedrückt wurde.
Ich hatte jetzt die Hoffnung, dass die Procedur onKeyDown mit der Variable Key vom Typ Word weiterhelfen könnte. Aber hier scheitere ich schon an dem Versuch den Wert auszulesen.
Wie kann ich ein Variable vom Typ Word in String konvertieren?
Bzw. gibt es für mein Problem vielleicht eine ganz andere bessere Alternative?

Danke im Vorraus!

Gruß MaX
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Sa 05.02.05 19:38 
So kann man "auslesen", welche Taste gedrückt wurde:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
ShowMessage(IntToStr(Key));
end;

Beispielprojekt ist das da: glaessi.piranho.com/delphi/kreis.zip !! :D

PS.: Wie immer rechts anklicken und "Speichern unter", sonst funktioniert es nicht!

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
HaRaH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Sa 05.02.05 20:03 
danke! :)
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Sa 05.02.05 20:06 
Kein Problem. 8) Funktioniert's??

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.