Autor Beitrag
mk3
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 36



BeitragVerfasst: Do 08.01.04 12:21 
Hallo!

Kann mir jemand helfen? Wie kann ich die Tastenkombination ausführen?
Ich habe mit der folgenden Code versucht, aber tbNeu.Click wird nie ausgeführt. Wenn ich Strg - Taste drücke, dann wird immer Key=17 geschickt.
Nur wenn ich alleine N drücke (ohne Strg), dann Key=78.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if (Shift = [ssCtrl]) and (Key=78then 
  tbNeu.Click;  // STRG+N
end;


Danke im voraus für jeden Hinweis!
mk

Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt.
teebee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 109


D6 Prof
BeitragVerfasst: Sa 10.01.04 22:00 
Also bei mir funktioniert das, allerdings nur, wenn KeyPreview auf True steht.

Gruß, teebee
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: So 11.01.04 12:44 
zur ergänzung:
in Tmenu, tpopupmenu und auch in tacionlist gibt es die im objectinspector die option shortcut schon vorprogrammiert.

_________________
Patrick
im zweifelsfall immer das richtige tun!!!