Hi,
ich habe eine neue Form mit einer Edit und Richedit Komponenten und einem label erstellt:
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: 34: 35: 36: 37: 38: 39: 40: 41: 42:
| var new_form: tform; new_btn:array of Tbutton; new_edit:array of tedit; new_memo: array of trichedit; new_label: array of tlabel; begin SetLength(new_btn, 20); SetLength(new_edit, 20); SetLength(new_memo, 20); SetLength(new_label, 20);
new_form:=TForm.CreateNew(Application); new_form.show;
new_edit[count]:=tedit.Create(new_form); new_edit[count].Parent:=new_form; new_edit[count].OnKeyDown:=mykeydown;
new_label[count]:=tlabel.create(new_form); new_label[count].Parent:=new_form; new_label[count].caption:=inttostr(count);
new_memo[count]:=trichedit.Create(new_form); new_memo[count].Parent:=new_form;
count:=count+1; end;
procedure TForm1.myKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if key=vk_return then begin new_memo[0].Lines.Add(tedit(sender).Text); form1.IdUDPClient1.Send(tedit(sender).Text); tedit(sender).Clear; end; |
Nun finde ich ja über
tedit(sender) herraus, welches Edit aktiv war, doch nun möchte ich gerne noch die Caption des Labels zusätlich in der Procedure myKeyDown abfragen und in einer Variable speichern.
Doch mein Problem ist, ich weiß nicht, wie ich das machen soll.
thx hibbert