Nomadic советует:
Примерно таким образом (Описываем метод-обработчик события OnClick формы):
{ Example } procedure TForm1.OnClick(ASender: TObject); var btnTemp: TButton; begin { Creating } btnTemp := TButton.Create(Self); { You can use 'with btnTemp do' operator below } { Inserting to Form } btnTemp.Parent := Self; { Initialization } btnTemp.Caption := 'I''m glad to see You'; btnTemp.SetBounds(20, 20, 80, 20); { You must define this event handler named 'OnBtnTempClick' } btnTemp.OnClick := OnBtnTempClick; { Ready to show } btnTemp.Visible := true; { Done. } end; |
[001189]