Autor Beitrag
Leathl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Sa 15.02.03 18:32 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:17, insgesamt 1-mal bearbeitet
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Sa 15.02.03 18:34 
in das keydown ereignis:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
case key of
vk_up: {code};
vk_down: {code};
vk_right: {code};
vk_left: {code};
end;

zusätzlich solltest du form1.keypreview auf true setzen;

Moderiert von user profile iconTino: Code-Tags aktiviert.
Leathl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Sa 15.02.03 18:45 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:18, insgesamt 1-mal bearbeitet
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Sa 15.02.03 18:49 
NEIN, lasse die eckigen klammern weg
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Sa 15.02.03 18:50 
die sollten nur darstellen, das da der code hinkommt
Leathl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Sa 15.02.03 18:51 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:18, insgesamt 1-mal bearbeitet
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Sa 15.02.03 19:10 
stelle form1.keypreview auf true;

und stelle die tabstopfunktion auf false;
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Sa 15.02.03 19:13 
ausblenden Quelltext
1:
2:
3:
4:
form1.keypreview := true;
form1.button1.tabstop := false;
form1.button2.tabstop := false;
...

(form1.button1.tabstop := false;) kannst du auch im objektinspector einstellen

Moderiert von user profile iconTino: Code-Tags hinzugefügt.
Leathl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Sa 15.02.03 19:14 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:18, insgesamt 1-mal bearbeitet
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Sa 15.02.03 19:21 
mach das doch so, das wenn ein button geklickt wurde, das er danach sofort wieder "deselektiert" wird
Leathl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Sa 15.02.03 19:27 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:18, insgesamt 1-mal bearbeitet
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Sa 15.02.03 22:32 
mach es einfach so...:

ausblenden Quelltext
1:
Button1.OnKeyDown:=Form1.OnKeyDown;					


Halt einfach dem OnKeyDown Event vom Button dasselbe zuweisen wie dem vom Form1.. (kannst du auch im ObjectInspector machen)

Au'revoir,
Aya

_________________
Aya
I aim for my endless dreams and I know they will come true!
Leathl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: So 16.02.03 18:18 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:19, insgesamt 1-mal bearbeitet
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: So 16.02.03 18:23 
Wenn ich das jetzt richtig verstanden habe willst du einen Button deaktivieren, oder!?!

ausblenden Quelltext
1:
Button1.enabled :=TRUE					
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 16.02.03 19:52 
ausblenden Quelltext
1:
Button1.enabled :=TRUE					


Wo mit er aktiviert wäre. :wink:

Was ist an dem Code von Aya unverständlöich?
Leathl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: So 16.02.03 19:56 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 12:19, insgesamt 1-mal bearbeitet
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: So 16.02.03 20:04 
Leathl hat folgendes geschrieben:
weiss nicht, was der bewirken soll :oops: ...

Er bewirkt das auch die Buttons auf die Pfeiltasten reagieren... somit auch dort das Ereigniss ausgelöst wird.

Leathl hat folgendes geschrieben:
also, ich will, dass wenn ich einen button klicke, dass der fokus wieder weggeht...

Damit verwirrst du nur deine User... aber bitte.. *g*
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form1.SetFocus;
end;


Au'revoir,
Aya

_________________
Aya
I aim for my endless dreams and I know they will come true!
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 16.02.03 20:12 
wieso verwirrt das die user :?:

er braucht es halt so, für sein tetris :!:
:wink:
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: So 16.02.03 20:18 
Weil es nicht dem Standart entspricht an den sich Otto Normalverbraucher gewöhnt hat ;)

_________________
Aya
I aim for my endless dreams and I know they will come true!
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: So 16.02.03 20:23 
:!: :idea: