Autor Beitrag
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Mo 16.05.05 19:01 
ich hab hier irgendwo im forum gesehen,
wie man z.b. die pfeiltaste nach links abfragen dran,
und wollte das gleich mal ausprobieren!

allerdings bekomm ich immer nen undeclared identifier, obwohl ichs genauso geschrieben hab wie bei anderen, bei denen es funktioniert hat!

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if chr(Key) = chr(vk_left)
  then  begin Form1.Button1.Enabled:=True;  end;
end;


end.


was mach ich falsch?
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 16.05.05 19:12 
Warum wandelst Du den Key in chr um ? Nehme : if key = VK_LEFT then 8) Dann steht die Prozedur gar nicht in der TForm-Deklaration. Also geht es so jedenfalls nicht !!

_________________
Gruß
Hansa
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Mo 16.05.05 19:26 
ausblenden Delphi-Quelltext
1:
Nehme : if key = VK_LEFT then					

das stimmt natürlich^^

Zitat:
Dann steht die Prozedur gar nicht in der TForm-Deklaration. Also geht es so jedenfalls nicht !!

soweit war ich auch^^

aber was soll ich jetzt machen? user defined image

Moderiert von user profile iconTino: Quote- & Delphi-Tags hinzugefügt.
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 16.05.05 19:31 
Gehe in OI und klicke bei den Events die Prozedur an.

_________________
Gruß
Hansa
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Mo 16.05.05 19:48 
DANKE!!!!!!

ok, soweit klappt das jetzt, ich kann mit den pfeiltasten un onkeydown ein bild bewegen....

aber sobald ich nen button oder editfeld draufmache, geht das nicht mehr richtig, weil ich dann mit den pfeiltasten irgendwie in den buttons navigiere :/

EDIT: ok habs geschafft, bei allen buttons einfach TabStop auf False....