Autor Beitrag
Girgl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Mi 12.05.04 15:43 
Servus,
wenn ich jetz eine Memo dynamisch erstell,wie kann ich rausfinden welche taste beim onKeyPress ereignis gedrückt wurde?
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Mi 12.05.04 15:48 
du musst deinem Memo ein onKeyPress ereignis zuweisen, dann kanst du das verarbeiten.

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Mi 12.05.04 16:31 
ja,aber wie übergeb ich der procedure,die das ereignis verarbeiten soll,die taste,die während des ereignisses gedrückt wurde?
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 12.05.04 17:11 
Hallo,

vielleicht hilft das?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
TForm1=class(TForm)
...
private
  procedure MyMemoKeyPress(Sender: TObject; var Key:Char);
...
end;

procedure TForm1.MyMemoKeyPress(Sender: TObject; var Key:Char);
begin
  ShowMessage(Format('Taste "%s" wurde gedrückt!', [Key])); 
end// TForm1.MyMemoKeyPress


// aufgerufen wird das ganze dann so:
...
  MyMemo:=TMemo.Create...
  MyMemo.OnKeyPress:=MyMemoKeyPress;
...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Girgl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 281


D6 Enterprise
BeitragVerfasst: Do 13.05.04 14:09 
ah besten dank,das geht