Autor Beitrag
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Di 15.08.06 18:04 
Huhu,
wenn man in einem Edit auf enter drückt erzeugt win ein geräusch, was wohl daran liegt das ein enter in einem edit nich wirklich sinn macht
gibt es eine mgölichkeit die ausgabe des geräusches zu verhindern?
ich habs mal so probiert war aber nich allzu erfolgreich...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  If Key = $0D Then 
  begin
    key:= $irgendwas
    Button1.Click;
  end;
end;
Florian Bernd
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 18

Win Vista 64 Bit
BDS 2009
BeitragVerfasst: Di 15.08.06 18:07 
So müsste es gehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  If Key = $0D Then 
  begin
    key:= #0;
    Button1.Click;
  end;
end;


Florian

_________________
Wenn man diese CD vorwärts spielt, sind satanische Verse zu hören. Viel schlimmer: Spielt man sie rückwärts, installiert sie Windows 98.
_frank_
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 343
Erhaltene Danke: 1

Win XP
Delphi 3 Prof / Turbo Delphi Explorer
BeitragVerfasst: Di 15.08.06 18:07 
wenn du OnKeyPress verwendest kannst du den ton mit key:=#0; ausschalten.
HTH Frank

_________________
EB FE (die wahrscheinlich kürzeste Endlosschleife der Welt :) )
BA 01 00 00 00 52 EB 09 BB 4D 11 86 7C FF D3 EB 0D E8 F2 FF FF FF 63 68 61 72 6D 61 70 00 C3
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 15.08.06 18:09 
user profile icon_frank_ hat folgendes geschrieben:
wenn du OnKeyPress verwendest kannst du den ton mit key:=#0; ausschalten.
HTH Frank

Yup. Im KeyDown gehts nicht, da Key:Word ist und #0 ein Char.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Ironwulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Di 15.08.06 18:31 
funktioniert irgendwie nich
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  If Key = '$0D' Then //habs auch mit '#0D' versucht
  begin
    key:= #0;
    Button1.Click;
  end;
end;
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 15.08.06 18:33 
user profile iconIronwulf hat folgendes geschrieben:
funktioniert irgendwie nich

Soll ich meine Kristallkugel holen? ;) Nun es funzt desshalb nicht, weil du nicht die entertaste sondern die $ Taste abfragst bzw einen String mit einem Char vergleichst. die Entertaste ist #13 nicht '$0D'.
'$0D' Sind 3 Chars, also ein 3 Buchstabiger string, während Key eine Char Variable ist...
genauso ist natürlich '#0D' ein String und kein Char. desshalb musst du bei #0 auch die ' weglassen ;)

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Ironwulf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Di 15.08.06 18:46 
oha genau daran lags konnt mir schon irgendwie denken dasses daran liegt aber hat halt keine ahnung wies sein muss thx