Autor Beitrag
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Mo 16.12.02 10:03 
Hi,

ich erstelle hier einige memo's zur Laufzeit nun will ich abfragen ob in dem aktuellen Memo eine Taste betätigt wurde. normal würde ich das Ereignis OnKeyPress nehmen aber da ich das memo zur laufzeit generiere ist das nicht so einfach und wenn es doch möglich sit übersteige es mein wissen.

kann mir da vielleicht jemand helfen.


gr€€tz
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: Mo 16.12.02 10:28 
Hallo,

wollen wir mal Dein Wissen erweitern:

1. Zuweisung des Ereignisses beim Erzeugen des Memeos:
ausblenden Quelltext
1:
2:
3:
4:
5:
  ...
  aMemo:=TMemo.Create(Self);
  aMemo.Parent:=Self;
  aMemo.OnKeyPress:=MyKeyPress;
  ...


2. Deklaration von MyKeyPress:
ausblenden Quelltext
1:
2:
3:
4:
  ...
  private
    procedure MyKeyPress(Sender:TObject; var Key:Char);
    ...


3. Coden von MyKeyPress:
ausblenden Quelltext
1:
2:
3:
4:
procedure TMyForm.MyKeyPress(Sender:TObject; var Key:Char);
begin
   if (Key in ['1'..'9', 'a'..'z']) then tuIrgendEtwas;
end;

Hoffe es hilft.

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

Win 2k
D7 Ent.
BeitragVerfasst: Mo 16.12.02 11:06 
hey :)


danke vielmals für deine hilfe :) kann ich so jedes ereigniss von einer komponente ansprechen :) is ja goil :) vielmals thx hast mir echt sehr geholfen :)

gr€€tz