N nonlyli Unregistered / Unconfirmed GUEST, unregistred user! 2003-01-29 #1 动态创建了一个MyLabel[10,10],但如何才能让它们收到Click消息呢?然后点那个就显示: 你Click了 myLabel[j]?
D delphiland Unregistered / Unconfirmed GUEST, unregistred user! 2003-01-29 #2 procedure TForm1.LabelsClick(Sender:TObject); begin ShowMessage(TLabel(Sender).Name); end; procedure TForm1.FormCreate(Sender: TObject); begin with TLabel.Create(self) do begin Parent := form1; Name :=... ... OnClick:=LabelsClick; end; end;
procedure TForm1.LabelsClick(Sender:TObject); begin ShowMessage(TLabel(Sender).Name); end; procedure TForm1.FormCreate(Sender: TObject); begin with TLabel.Create(self) do begin Parent := form1; Name :=... ... OnClick:=LabelsClick; end; end;