Autor Beitrag
mambo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Mo 08.07.02 08:19 
Hallo !

Ich habe ein großes Problem:
Ich möchte in meinem Edit-Feld eine Prozedur ausführen, wenn die Taste Enter gedrückt wird. Issja einfach. So weit so gut.

Nur wird jedesmal, wenn man in einem Edit-Feld die Entertaste (oder auch bei Esc) drückt, das Windows-Standardtonsignal ausgelöst!!!! Bei Dropdownlists z.B. ist das nicht der Fall!!!!

Wie kann ich das vermeiden????

Danke
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mo 08.07.02 08:53 
Hallo,

wenn ich mich recht entsinne musstest du in dem Fall im OnKeyDown Key auf 0 setzen. Es genügte nicht im OnKeyPressed Key auf #0 zu setzen.
Also versuche mal deine Behandlungsroutine in OnKeyDown zu verlegen.

Gruß
Klabautermann
mambo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Mo 08.07.02 09:12 
hm...funktioniert irgendwie nicht... habe bei onkeydown folgende Prozedur:

Key := 0;

aber das Tonsignal kommt immer noch!!!!

wie kann ich GENERELL vermeiden, daß beim Drücken der Taste "ENTER" in einem Edit-Feld das Standardtonsignal erklingt ????
Da muß ich doch nicht bei jedem Edit-Feld bei OnKeyDown den Key auf 0 setzen (was ja bei mir auch nicht funktioniert), oder ?

Hoffe jemand kann mir helfen
Heinz
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Mo 08.07.02 13:20 
ausblenden Quelltext
1:
2:
3:
4:
If Key = #13 then begin
  Key := #0;
  DeineProcedure;
end;


So sollte das gehen.
mambo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Mo 08.07.02 13:23 
Super, danke!!

Alibi hat folgendes geschrieben:
If Key = #13 then begin
Key := #0;
DeineProcedure;
end;

So sollte das gehen.
msoehnchen
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Mi 13.11.02 14:21 
mambo hat folgendes geschrieben:
Super, danke!!

Alibi hat folgendes geschrieben:
If Key = #13 then begin
Key := #0;
DeineProcedure;
end;

So sollte das gehen.


Hmm, bei mir kommt dann aber ein fehler, das word und char nicht zusammenpassen....

kann mir ma einer helfen...wieso klappt es bei den anderen und bei mir nicht....

_________________
...Let´s Rule The World...
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Mi 13.11.02 16:55 
Vielleicht hast du es in die falsche Prozedur geschrieben.
Vergleiche mal, von welchem Typ die Variable Key ist. Bei OnKeyDown und OnKeyPress sind es unterschiedliche. Das eine ist Word und das andere Char.

_________________
If accidentally read, induce vomitting.